[][src]Struct var_byte_str::VarByteString

pub struct VarByteString { /* fields omitted */ }

The core struct that represent variable byte encoded of gap of string.

See module documentation for more detail

Implementations

impl VarByteString[src]

pub fn buffer_len(&self) -> usize[src]

Return number of bytes of buffer that represent the string

pub fn sign_len(&self) -> usize[src]

Return number of bit of sign that represent the string

pub fn len(&self) -> usize[src]

pub fn size(&self) -> usize[src]

Return number of bytes this object require to represent the string

pub fn chars(&self) -> Chars

Important traits for Chars<'a>

impl<'a> Iterator for Chars<'a> type Item = char;
[src]

Return an iterator of chars where each iteration return a char primitive converted from this representation.

pub fn gaps(&self) -> Gaps

Important traits for Gaps<'a>

impl<'a> Iterator for Gaps<'a> type Item = i64;
[src]

Return an iterator of gaps where each iteration return a different between current character and previous character. The first iteration always return a code point. It return code point "as is" from original value.

pub fn gaps_bytes(&self) -> GapsBytes

Important traits for GapsBytes<'a>

impl<'a> Iterator for GapsBytes<'a> type Item = (bool, SmallVec<[u8; 5]>);
[src]

Return an iterator of bytes of gap where each iteration return a tuple of bool and SmallVec<[u8; 5]>. The bool part is true when the bytes it represent should be convert to negative value. The SmallVec<[u8; 5]> part contain absolute value of different in least significant byte first order.

Trait Implementations

impl Clone for VarByteString[src]

impl Debug for VarByteString[src]

impl Display for VarByteString[src]

impl Eq for VarByteString[src]

impl<S> From<S> for VarByteString where
    S: Borrow<str>, 
[src]

Add a way to construct this object from any kind of str

impl Hash for VarByteString[src]

impl<'a> Into<String> for &'a VarByteString[src]

Add a way to convert back this object into String

impl<'a> Into<String> for VarByteString[src]

Add a way to consume this object and turn it into String

impl<S> PartialEq<S> for VarByteString where
    S: Borrow<str>, 
[src]

Allow VarByteString to allow using operator == with &str

fn eq(&self, other: &S) -> bool[src]

It compare with &str by encodes other string into variable gap bytes then compare it to self.

impl PartialEq<VarByteString> for VarByteString[src]

impl<S> PartialOrd<S> for VarByteString where
    S: Borrow<str>, 
[src]

Allow VarByteString to be comparable with &str

fn partial_cmp(&self, other: &S) -> Option<Ordering>[src]

It compare by encode other as &str into variable gap bytes and compare based on sign and bytes

impl StructuralEq for VarByteString[src]

impl StructuralPartialEq for VarByteString[src]

Auto Trait Implementations

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.