[−][src]Struct ghakuf::formats::VLQBuilder
VLQ Builder from u8 values.
Examples
use ghakuf::formats::{VLQ, VLQBuilder}; let vlq = VLQBuilder::new().push(0x86).push(0xc3).push(0x17).build(); assert_eq!(vlq.val(), 106_903); assert_eq!(vlq.binary(), [0x86, 0xc3, 0x17]); assert_eq!(vlq.len(), 3);
Implementations
impl VLQBuilder
[src]
pub fn new() -> VLQBuilder
[src]
Builds VLQBuilder.
Examples
use ghakuf::formats::VLQBuilder; let vlq_builder: VLQBuilder = VLQBuilder::new();
pub fn push(&mut self, data: u8) -> &mut VLQBuilder
[src]
Pushes u8 value for VLQ to VLQBuilder.
Examples
use ghakuf::formats::VLQBuilder; let mut vlq_builder = VLQBuilder::new(); vlq_builder.push(0x86).push(0xc3).push(0x17);
Note: VLQBuilder can accept only 4 u8 value due to SMF restriction. This method ignore after the fifth.
pub fn closed(&self) -> bool
[src]
Checks whether VLQBuilder is saturated or not.
Examples
use ghakuf::formats::VLQBuilder; let mut vlq_builder = VLQBuilder::new(); vlq_builder.push(0x86).push(0xc3); assert!(!vlq_builder.closed()); vlq_builder.push(0x17).push(0xa2); assert!(vlq_builder.closed());
pub fn build(&self) -> VLQ
[src]
Builds VLQ from VLQBuilder.
Examples
use ghakuf::formats::{VLQ, VLQBuilder}; let vlq: VLQ = VLQBuilder::new().push(0x12).build();
Auto Trait Implementations
impl RefUnwindSafe for VLQBuilder
impl Send for VLQBuilder
impl Sync for VLQBuilder
impl Unpin for VLQBuilder
impl UnwindSafe for VLQBuilder
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<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>,