pub struct DescriptorFlags(pub u32);Expand description
Descriptor flags bitmask (wire field flags, offset 10 in the fixed header).
Each bit selects an optional section that follows the buffer table. Bits 4–31
are reserved and MUST be 0.
§Examples
use hurray_core::descriptor::DescriptorFlags;
let f = DescriptorFlags(DescriptorFlags::HAS_QUANTIZATION | DescriptorFlags::HAS_SHARD);
assert!(f.has_quantization());
assert!(f.has_shard());
assert!(!f.has_statistics());
assert!(!f.has_extension_type());
assert!(!f.has_composite_member());Tuple Fields§
§0: u32Implementations§
Source§impl DescriptorFlags
impl DescriptorFlags
Sourcepub const HAS_QUANTIZATION: u32
pub const HAS_QUANTIZATION: u32
Bit 0: quantization section is present.
Sourcepub const HAS_EXTENSION_TYPE: u32
pub const HAS_EXTENSION_TYPE: u32
Bit 2: extension type section is present.
Sourcepub const HAS_STATISTICS: u32
pub const HAS_STATISTICS: u32
Bit 3: statistics section is present.
Sourcepub const HAS_COMPOSITE_MEMBER: u32
pub const HAS_COMPOSITE_MEMBER: u32
Bit 4: Composite Member section is present. Set on the members of an
overlay composite; see docs/spec/layouts/composite.md.
Sourcepub fn has_quantization(self) -> bool
pub fn has_quantization(self) -> bool
Returns true if the HAS_QUANTIZATION bit is set.
Sourcepub fn has_extension_type(self) -> bool
pub fn has_extension_type(self) -> bool
Returns true if the HAS_EXTENSION_TYPE bit is set.
Sourcepub fn has_statistics(self) -> bool
pub fn has_statistics(self) -> bool
Returns true if the HAS_STATISTICS bit is set.
Sourcepub fn has_composite_member(self) -> bool
pub fn has_composite_member(self) -> bool
Returns true if the HAS_COMPOSITE_MEMBER bit is set.
Trait Implementations§
Source§impl Clone for DescriptorFlags
impl Clone for DescriptorFlags
Source§fn clone(&self) -> DescriptorFlags
fn clone(&self) -> DescriptorFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DescriptorFlags
Source§impl Debug for DescriptorFlags
impl Debug for DescriptorFlags
impl Eq for DescriptorFlags
Source§impl PartialEq for DescriptorFlags
impl PartialEq for DescriptorFlags
Source§fn eq(&self, other: &DescriptorFlags) -> bool
fn eq(&self, other: &DescriptorFlags) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DescriptorFlags
Auto Trait Implementations§
impl Freeze for DescriptorFlags
impl RefUnwindSafe for DescriptorFlags
impl Send for DescriptorFlags
impl Sync for DescriptorFlags
impl Unpin for DescriptorFlags
impl UnsafeUnpin for DescriptorFlags
impl UnwindSafe for DescriptorFlags
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