pub struct FinderFlags(/* private fields */);Expand description
Flags from the file information record used by Finder to manage files.
Adopted from Macintosh Toolbox Essentials, 7-47
use macintosh_utils::FinderFlags;
let flags = FinderFlags::from_bits(0x500).unwrap();
assert!(flags.contains(FinderFlags::CUSTOMICON));
assert!(flags.contains(FinderFlags::INITED));
assert!(!flags.contains(FinderFlags::INVISIBLE));Implementations§
Source§impl FinderFlags
impl FinderFlags
Sourcepub const ALIAS: Self
pub const ALIAS: Self
For a file, this bit indicates that the file is an alias file. For directories, this bit is reserved—in which case, set to 0.
Sourcepub const INVISIBLE: Self
pub const INVISIBLE: Self
The file or directory is invisible from the Finder and from the Standard File Package dialog boxes.
Sourcepub const BUNDLE: Self
pub const BUNDLE: Self
For a file, this bit indicates that the file contains a bundle resource. For directories, this bit is reserved – in which case, set to 0.
Sourcepub const NAMELOCKED: Self
pub const NAMELOCKED: Self
The file or directory can’t be renamed from the Finder, and the icon cannot be changed.
Sourcepub const STATIONERY: Self
pub const STATIONERY: Self
This flag specifies that a file is a stationery pad and should be treated as a document template rather than a document itself
Sourcepub const CUSTOMICON: Self
pub const CUSTOMICON: Self
The file or directory contains a customized icon
Sourcepub const INITED: Self
pub const INITED: Self
The Finder has recorded information from the file’s bundle resource into the desktop database and given the file or folder a position on the desktop.
Sourcepub const NOINIT: Self
pub const NOINIT: Self
The file contains no ‘INIT’ resources; set to 0. Reserved for directories; set to 0.
Sourcepub const SHARED: Self
pub const SHARED: Self
The file is an application that can be executed by multiple users simultaneously. Defined only for applications; otherwise, set to 0.
Sourcepub const SWITCH_LAUNCH: Self
pub const SWITCH_LAUNCH: Self
Unused and reserved in System 7; set to 0.
Sourcepub const COLOR_RESERVED: Self
pub const COLOR_RESERVED: Self
Unused and reserved in System 7; set to 0.
Sourcepub const ON_DESKTOP: Self
pub const ON_DESKTOP: Self
Unused and reserved in System 7; set to 0.
Source§impl FinderFlags
impl FinderFlags
Sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u16) -> Option<Self>
pub const fn from_bits(bits: u16) -> Option<Self>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u16) -> Self
pub const fn from_bits_truncate(bits: u16) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u16) -> Self
pub const fn from_bits_retain(bits: u16) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl FinderFlags
impl FinderFlags
Sourcepub const fn iter(&self) -> Iter<FinderFlags>
pub const fn iter(&self) -> Iter<FinderFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<FinderFlags>
pub const fn iter_names(&self) -> IterNames<FinderFlags>
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl BinRead for FinderFlags
impl BinRead for FinderFlags
Source§fn read_options<R: Read + Seek>(
reader: &mut R,
_endian: Endian,
_args: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( reader: &mut R, _endian: Endian, _args: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Binary for FinderFlags
impl Binary for FinderFlags
Source§impl BitAnd for FinderFlags
impl BitAnd for FinderFlags
Source§impl BitAndAssign for FinderFlags
impl BitAndAssign for FinderFlags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for FinderFlags
impl BitOr for FinderFlags
Source§fn bitor(self, other: FinderFlags) -> Self
fn bitor(self, other: FinderFlags) -> Self
The bitwise or (|) of the bits in two flags values.
Source§type Output = FinderFlags
type Output = FinderFlags
| operator.Source§impl BitOrAssign for FinderFlags
impl BitOrAssign for FinderFlags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for FinderFlags
impl BitXor for FinderFlags
Source§impl BitXorAssign for FinderFlags
impl BitXorAssign for FinderFlags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for FinderFlags
impl Clone for FinderFlags
Source§fn clone(&self) -> FinderFlags
fn clone(&self) -> FinderFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FinderFlags
Source§impl Debug for FinderFlags
impl Debug for FinderFlags
Source§impl Default for FinderFlags
impl Default for FinderFlags
Source§fn default() -> FinderFlags
fn default() -> FinderFlags
Source§impl Extend<FinderFlags> for FinderFlags
impl Extend<FinderFlags> for FinderFlags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Flags for FinderFlags
impl Flags for FinderFlags
Source§const FLAGS: &'static [Flag<FinderFlags>]
const FLAGS: &'static [Flag<FinderFlags>]
Source§fn from_bits_retain(bits: u16) -> FinderFlags
fn from_bits_retain(bits: u16) -> FinderFlags
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.Source§impl FromIterator<FinderFlags> for FinderFlags
impl FromIterator<FinderFlags> for FinderFlags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|) of the bits in each flags value.
Source§impl IntoIterator for FinderFlags
impl IntoIterator for FinderFlags
Source§impl LowerHex for FinderFlags
impl LowerHex for FinderFlags
Source§impl Not for FinderFlags
impl Not for FinderFlags
Source§impl Octal for FinderFlags
impl Octal for FinderFlags
Source§impl PublicFlags for FinderFlags
impl PublicFlags for FinderFlags
Source§impl Sub for FinderFlags
impl Sub for FinderFlags
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = FinderFlags
type Output = FinderFlags
- operator.Source§impl SubAssign for FinderFlags
impl SubAssign for FinderFlags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.