pub struct Filter { /* private fields */ }
Implementations§
Source§impl Filter
impl Filter
Sourcepub const fn all() -> Filter
pub const fn all() -> Filter
Returns the set containing all flags.
Examples found in repository?
examples/extract.rs (line 21)
10fn main() {
11 let args: Vec<_> = env::args().skip(1).collect();
12 if args.len() != 2 || args.iter().any(|arg| arg.contains("-h")) {
13 println!("Usage: extract <chm-file> <out-dir>");
14 return;
15 }
16
17 let mut file = ChmFile::open(&args[0]).expect("Unable to open the file");
18
19 let out_dir = PathBuf::from(&args[1]);
20
21 file.for_each(Filter::all(), |file, item| extract(&out_dir, file, &item))
22 .unwrap();
23}
More examples
examples/enumerate-items.rs (line 16)
5fn main() {
6 let filename = env::args()
7 .nth(1)
8 .unwrap_or_else(|| panic!("Usage: enumerate-items <filename>"));
9
10 let mut file = ChmFile::open(&filename).expect("Unable to open the file");
11
12 println!("{}:", filename);
13 println!(" spc start length type\t\t\tname");
14 println!(" === ===== ====== ====\t\t\t====");
15
16 file.for_each(Filter::all(), |_file, item| {
17 describe_item(item);
18 Continuation::Continue
19 })
20 .unwrap();
21}
Sourcepub fn from_bits(bits: c_int) -> Option<Filter>
pub fn from_bits(bits: c_int) -> Option<Filter>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: c_int) -> Filter
pub const fn from_bits_truncate(bits: c_int) -> Filter
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: c_int) -> Filter
pub const unsafe fn from_bits_unchecked(bits: c_int) -> Filter
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: Filter) -> bool
pub const fn intersects(&self, other: Filter) -> bool
Returns true
if there are flags common to both self
and other
.
Trait Implementations§
Source§impl BitAndAssign for Filter
impl BitAndAssign for Filter
Source§fn bitand_assign(&mut self, other: Filter)
fn bitand_assign(&mut self, other: Filter)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Filter
impl BitOrAssign for Filter
Source§fn bitor_assign(&mut self, other: Filter)
fn bitor_assign(&mut self, other: Filter)
Adds the set of flags.
Source§impl BitXorAssign for Filter
impl BitXorAssign for Filter
Source§fn bitxor_assign(&mut self, other: Filter)
fn bitxor_assign(&mut self, other: Filter)
Toggles the set of flags.
Source§impl Extend<Filter> for Filter
impl Extend<Filter> for Filter
Source§fn extend<T: IntoIterator<Item = Filter>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Filter>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Filter> for Filter
impl FromIterator<Filter> for Filter
Source§impl Ord for Filter
impl Ord for Filter
Source§impl PartialOrd for Filter
impl PartialOrd for Filter
Source§impl SubAssign for Filter
impl SubAssign for Filter
Source§fn sub_assign(&mut self, other: Filter)
fn sub_assign(&mut self, other: Filter)
Disables all flags enabled in the set.
impl Copy for Filter
impl Eq for Filter
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
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