Struct sled::IVec [−][src]
pub struct IVec(_);
Expand description
A buffer that may either be inline or remote and protected by an Arc
Implementations
Create a subslice of this IVec
that shares
the same backing data and reference counter.
Panics
Panics if self.len() - offset >= len
.
Examples
let iv = IVec::from(vec![1]);
let subslice = iv.subslice(0, 1);
assert_eq!(&subslice, &[1]);
let subslice = subslice.subslice(0, 1);
assert_eq!(&subslice, &[1]);
let subslice = subslice.subslice(1, 0);
assert_eq!(&subslice, &[]);
let subslice = subslice.subslice(0, 0);
assert_eq!(&subslice, &[]);
let iv2 = IVec::from(vec![1, 2, 3]);
let subslice = iv2.subslice(3, 0);
assert_eq!(&subslice, &[]);
let subslice = iv2.subslice(2, 1);
assert_eq!(&subslice, &[3]);
let subslice = iv2.subslice(1, 2);
assert_eq!(&subslice, &[2, 3]);
let subslice = iv2.subslice(0, 3);
assert_eq!(&subslice, &[1, 2, 3]);
let subslice = subslice.subslice(1, 2);
assert_eq!(&subslice, &[2, 3]);
let subslice = subslice.subslice(1, 1);
assert_eq!(&subslice, &[3]);
let subslice = subslice.subslice(1, 0);
assert_eq!(&subslice, &[]);
Trait Implementations
Creates a value from an iterator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for IVec
impl UnwindSafe for IVec
Blanket Implementations
Mutably borrows from an owned value. Read more