pub struct SavedFilter {
pub name: String,
pub rule: Value,
pub extra: Extra,
}Expand description
One entry of saved-filters.json: a name and a snapshot of the filter
panel’s rules. Entries have no id; Eagle finds them by position.
Fields§
§name: StringDisplay name.
rule: ValueThe panel’s rule object at save time (see SavedFilter::to_filter),
plus keyword when a search was active. Kept as raw JSON so every
rule Eagle knows survives.
extra: ExtraUnknown keys.
Implementations§
Source§impl SavedFilter
impl SavedFilter
Sourcepub fn to_filter(&self) -> SavedFilterQuery
pub fn to_filter(&self) -> SavedFilterQuery
Reads the saved rules into a crate::search::Filter. Eagle does not
save whether tags and folders combine with OR, AND or EQUAL (that
setting lives in the panel), so they come back as OR, the panel’s
starting value. A font rule reads the activated fonts from Eagle’s
font folder and falcon’s (crate::search::font_dirs).
Sourcepub fn to_filter_with_fonts(
&self,
font_keys: impl FnOnce() -> HashSet<String>,
) -> SavedFilterQuery
pub fn to_filter_with_fonts( &self, font_keys: impl FnOnce() -> HashSet<String>, ) -> SavedFilterQuery
SavedFilter::to_filter with the activated font keys supplied;
font_keys is only called when the font rule is on.
Sourcepub fn rule_from_filter(
filter: &Filter,
keyword: Option<&str>,
folder_name: impl Fn(&str) -> Option<String>,
) -> Value
pub fn rule_from_filter( filter: &Filter, keyword: Option<&str>, folder_name: impl Fn(&str) -> Option<String>, ) -> Value
Builds the rule object Eagle’s panel would save for filter: its
full default rule set (as JSON.stringify writes it, integer-like
keys first) with falcon’s rules filled in. folder_name looks up a
folder’s name; Eagle stores whole folder objects under
folder.includes, of which it only reads id back, so falcon writes
{id, name}. The tag and folder logic is not part of the rule, and
the AI rules are added with SavedAiRules::write_to.
Trait Implementations§
Source§impl Clone for SavedFilter
impl Clone for SavedFilter
Source§fn clone(&self) -> SavedFilter
fn clone(&self) -> SavedFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SavedFilter
impl Debug for SavedFilter
Source§impl<'de> Deserialize<'de> for SavedFilter
impl<'de> Deserialize<'de> for SavedFilter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SavedFilter
impl PartialEq for SavedFilter
Source§impl Serialize for SavedFilter
impl Serialize for SavedFilter
impl StructuralPartialEq for SavedFilter
Auto Trait Implementations§
impl Freeze for SavedFilter
impl RefUnwindSafe for SavedFilter
impl Send for SavedFilter
impl Sync for SavedFilter
impl Unpin for SavedFilter
impl UnsafeUnpin for SavedFilter
impl UnwindSafe for SavedFilter
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more