pub struct MagicRule { /* private fields */ }Expand description
Represents a parsed magic rule
Implementations§
Source§impl MagicRule
impl MagicRule
Sourcepub fn is_text(&self) -> bool
pub fn is_text(&self) -> bool
Checks if the rule is for matching against text content
§Returns
bool- True if the rule is for text files
Sourcepub fn extensions(&self) -> &HashSet<String>
pub fn extensions(&self) -> &HashSet<String>
Gets all the file extensions associated to the rule
§Returns
&HashSet<String>- The set of all associated extensions
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MagicRule
impl<'de> Deserialize<'de> for MagicRule
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MagicRule
impl RefUnwindSafe for MagicRule
impl Send for MagicRule
impl Sync for MagicRule
impl Unpin for MagicRule
impl UnwindSafe for MagicRule
Blanket Implementations§
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
Mutably borrows from an owned value. Read more