[][src]Enum compressed_vec::section::FixedSectEnum

pub enum FixedSectEnum<'buf, T: VectBase> {
    NullFixedSect(NullFixedSect),
    NibblePackMedFixedSect(NibblePackMedFixedSect<'buf, T>),
    DeltaNPMedFixedSect(DeltaNPMedFixedSect<'buf, T>),
    ConstFixedSect(ConstFixedSect<'buf, T>),
    XorNPMedFixedSect(XorNPMedFixedSect<'buf>),
}

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]

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(&sect_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]

impl<'buf, T: VectBase> From<ConstFixedSect<'buf, T>> for FixedSectEnum<'buf, T>[src]

impl<'buf, T: VectBase> From<DeltaNPMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>[src]

impl<'buf, T: VectBase> From<NibblePackMedFixedSect<'buf, T>> for FixedSectEnum<'buf, T>[src]

impl<'buf, T: VectBase> From<NullFixedSect> for FixedSectEnum<'buf, T>[src]

impl<'buf, T: VectBase> From<XorNPMedFixedSect<'buf>> for FixedSectEnum<'buf, T>[src]

impl<'buf, T: PartialEq + VectBase> PartialEq<FixedSectEnum<'buf, T>> for FixedSectEnum<'buf, T>[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.

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.

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.

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.

impl<'buf, T: VectBase> TryInto<XorNPMedFixedSect<'buf>> for FixedSectEnum<'buf, T>[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'buf, T> RefUnwindSafe for FixedSectEnum<'buf, T> where
    T: RefUnwindSafe

impl<'buf, T> Send for FixedSectEnum<'buf, T> where
    T: Send

impl<'buf, T> Sync for FixedSectEnum<'buf, T> where
    T: Sync

impl<'buf, T> Unpin for FixedSectEnum<'buf, T> where
    T: Unpin

impl<'buf, T> UnwindSafe for FixedSectEnum<'buf, T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 
[src]

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]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.