pub enum MaybeOwnedIndex<'a> {
Borrowed(Index<'a>),
Owned(Index),
}Expand description
A CFF INDEX that can hold borrowed or owned data.
Variants§
Implementations§
Source§impl<'a> MaybeOwnedIndex<'a>
impl<'a> MaybeOwnedIndex<'a>
pub fn iter(&'a self) -> MaybeOwnedIndexIterator<'a> ⓘ
pub fn read_object(&self, index: usize) -> Option<&[u8]>
Sourcepub fn replace(&mut self, idx: usize, object: Vec<u8>)
pub fn replace(&mut self, idx: usize, object: Vec<u8>)
Replace the object at idx with object.
If self is Borrowed then it is converted to the Owned variant first.
Panics
Panics if idx is out of bounds.
pub fn data_len(&self) -> usize
Trait Implementations§
Source§impl<'a> Clone for MaybeOwnedIndex<'a>
impl<'a> Clone for MaybeOwnedIndex<'a>
Source§fn clone(&self) -> MaybeOwnedIndex<'a>
fn clone(&self) -> MaybeOwnedIndex<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for MaybeOwnedIndex<'a>
impl<'a> RefUnwindSafe for MaybeOwnedIndex<'a>
impl<'a> Send for MaybeOwnedIndex<'a>
impl<'a> Sync for MaybeOwnedIndex<'a>
impl<'a> Unpin for MaybeOwnedIndex<'a>
impl<'a> UnwindSafe for MaybeOwnedIndex<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more