[−][src]Enum compressed_vec::section::FixedSectEnum
A FixedSectEnum is an enum over different FixedSection implementations, for the purpose of very fast, inlineable iteration over different section types without resorting to dynamic method calls.
Variants
NullFixedSect(NullFixedSect)
NibblePackMedFixedSect(NibblePackMedFixedSect<'buf, T>)
DeltaNPMedFixedSect(DeltaNPMedFixedSect<'buf, T>)
ConstFixedSect(ConstFixedSect<'buf, T>)
XorNPMedFixedSect(XorNPMedFixedSect<'buf>)
Implementations
impl<'buf, T: VectBase> FixedSectEnum<'buf, T>
[src]
pub fn decode<S>(self, sink: &mut S) -> Result<(), CodingError> where
S: Sink<T::SI>,
[src]
S: Sink<T::SI>,
Decodes this section based on items of type T to a Sink. This is the main decoding API. Note that you need to specify an explicit base type as FixedSectEnums are typeless. For example, to write to the generic section sink which materializes every value in a section:
let sect = FixedSectEnum::<u32>::try_from(§_bytes[..]).unwrap(); let mut sink = compressed_vec::sink::U32_256Sink::new(); sect.decode(&mut sink).unwrap(); println!("{:?}", sink.values.iter().count());
pub fn is_null(&self) -> bool
[src]
Is this a null section?
Trait Implementations
impl<'buf, T: Debug + VectBase> Debug for FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> FixedSection for FixedSectEnum<'buf, T>
[src]
fn num_bytes(&self) -> usize
[src]
fn num_elements(&self) -> usize
[src]
fn sect_bytes(&self) -> Option<&[u8]>
[src]
fn sect_type(&self) -> SectionType
[src]
impl<'buf, T: VectBase> From<ConstFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
fn from(v: ConstFixedSect<'buf, T>) -> FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> From<DeltaNPMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
fn from(v: DeltaNPMedFixedSect<'buf, T>) -> FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> From<NibblePackMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
fn from(v: NibblePackMedFixedSect<'buf, T>) -> FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> From<NullFixedSect> for FixedSectEnum<'buf, T>
[src]
fn from(v: NullFixedSect) -> FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> From<XorNPMedFixedSect<'buf>> for FixedSectEnum<'buf, T>
[src]
fn from(v: XorNPMedFixedSect<'buf>) -> FixedSectEnum<'buf, T>
[src]
impl<'buf, T: PartialEq + VectBase> PartialEq<FixedSectEnum<'buf, T>> for FixedSectEnum<'buf, T>
[src]
fn eq(&self, other: &FixedSectEnum<'buf, T>) -> bool
[src]
fn ne(&self, other: &FixedSectEnum<'buf, T>) -> bool
[src]
impl<'buf, T: VectBase> StructuralPartialEq for FixedSectEnum<'buf, T>
[src]
impl<'buf, T: VectBase> TryFrom<&'buf [u8]> for FixedSectEnum<'buf, T>
[src]
type Error = CodingError
The type returned in the event of a conversion error.
fn try_from(s: &'buf [u8]) -> Result<FixedSectEnum<'buf, T>, CodingError>
[src]
Tries to extract a FixedSection from a slice, whose first byte contains the section type byte. The length of the slice should contain at least all the data in the section.
impl<'buf, T: VectBase> TryInto<ConstFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> Result<ConstFixedSect<'buf, T>, Self::Error>
[src]
impl<'buf, T: VectBase> TryInto<DeltaNPMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> Result<DeltaNPMedFixedSect<'buf, T>, Self::Error>
[src]
impl<'buf, T: VectBase> TryInto<NibblePackMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> Result<NibblePackMedFixedSect<'buf, T>, Self::Error>
[src]
impl<'buf, T: VectBase> TryInto<NullFixedSect> for FixedSectEnum<'buf, T>
[src]
type Error = &'static str
The type returned in the event of a conversion error.
fn try_into(self) -> Result<NullFixedSect, Self::Error>
[src]
impl<'buf, T: VectBase> TryInto<XorNPMedFixedSect<'buf>> for FixedSectEnum<'buf, T>
[src]
Auto Trait Implementations
impl<'buf, T> RefUnwindSafe for FixedSectEnum<'buf, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'buf, T> Send for FixedSectEnum<'buf, T> where
T: Send,
T: Send,
impl<'buf, T> Sync for FixedSectEnum<'buf, T> where
T: Sync,
T: Sync,
impl<'buf, T> Unpin for FixedSectEnum<'buf, T> where
T: Unpin,
T: Unpin,
impl<'buf, T> UnwindSafe for FixedSectEnum<'buf, T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
[src]
U: FromCast<T>,
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
[src]
impl<T> FromCast<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
[src]
U: FromBits<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,