Struct blockbuffers::position::VectorPosition
source · pub struct VectorPosition(pub usize);
Expand description
VectorPosition wrappers a position which points to a vector in the buffer.
Vectors are stored as contiguous aligned scalar elements prefixed by a 32bit element count.
Examples
use blockbuffers::position::VectorPosition;
let buf = &[02u8, 0, 0, 0, 1, 0, 2, 0, 3, 0][..];
let pos = VectorPosition(0);
assert_eq!(2, pos.len(buf));
assert_eq!(&[1u16.to_le(), 2u16.to_le()], pos.as_slice::<u16>(buf));
Tuple Fields
0: usize
Implementations
Trait Implementations
sourceimpl Clone for VectorPosition
impl Clone for VectorPosition
sourcefn clone(&self) -> VectorPosition
fn clone(&self) -> VectorPosition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for VectorPosition
impl Debug for VectorPosition
sourceimpl PartialEq<VectorPosition> for VectorPosition
impl PartialEq<VectorPosition> for VectorPosition
sourcefn eq(&self, other: &VectorPosition) -> bool
fn eq(&self, other: &VectorPosition) -> bool
sourceimpl PartialOrd<VectorPosition> for VectorPosition
impl PartialOrd<VectorPosition> for VectorPosition
sourcefn partial_cmp(&self, other: &VectorPosition) -> Option<Ordering>
fn partial_cmp(&self, other: &VectorPosition) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for VectorPosition
impl StructuralPartialEq for VectorPosition
Auto Trait Implementations
impl RefUnwindSafe for VectorPosition
impl Send for VectorPosition
impl Sync for VectorPosition
impl Unpin for VectorPosition
impl UnwindSafe for VectorPosition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more