pub struct OmenHeader {Show 15 fields
pub version_major: u16,
pub version_minor: u16,
pub flags: u64,
pub dimensions: u32,
pub count: u64,
pub quantization: QuantizationCode,
pub distance_fn: Metric,
pub m: u16,
pub ef_construction: u16,
pub ef_search: u16,
pub max_level: u8,
pub entry_point: u32,
pub sections: [SectionEntry; 8],
pub header_checksum: u32,
pub data_checksum: u32,
}Expand description
.omen file header
Fields§
§version_major: u16§version_minor: u16§flags: u64§dimensions: u32§count: u64§quantization: QuantizationCode§distance_fn: Metric§m: u16§ef_construction: u16§ef_search: u16§max_level: u8§entry_point: u32§sections: [SectionEntry; 8]§header_checksum: u32§data_checksum: u32Implementations§
Source§impl OmenHeader
impl OmenHeader
Sourcepub fn from_bytes(buf: &[u8; 4096]) -> Result<Self>
pub fn from_bytes(buf: &[u8; 4096]) -> Result<Self>
Parse header from bytes
Sourcepub fn get_section(&self, section_type: SectionType) -> Option<&SectionEntry>
pub fn get_section(&self, section_type: SectionType) -> Option<&SectionEntry>
Get section by type
Sourcepub fn set_section(&mut self, entry: SectionEntry)
pub fn set_section(&mut self, entry: SectionEntry)
Set section entry
Trait Implementations§
Source§impl Clone for OmenHeader
impl Clone for OmenHeader
Source§fn clone(&self) -> OmenHeader
fn clone(&self) -> OmenHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OmenHeader
impl Debug for OmenHeader
Auto Trait Implementations§
impl Freeze for OmenHeader
impl RefUnwindSafe for OmenHeader
impl Send for OmenHeader
impl Sync for OmenHeader
impl Unpin for OmenHeader
impl UnwindSafe for OmenHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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