pub struct MeteredVector<A> { /* private fields */ }
Implementations§
Source§impl<A> MeteredVector<A>where
A: MeteredClone,
impl<A> MeteredVector<A>where
A: MeteredClone,
pub fn new() -> Self
pub fn from_vec(vec: Vec<A>) -> Result<Self, HostError>
pub fn as_slice(&self) -> &[A]
pub fn as_mut_slice(&mut self) -> &mut [A]
pub fn from_exact_iter<I: Iterator<Item = A>>( iter: I, budget: &Budget, ) -> Result<Self, HostError>
pub fn set( &self, index: usize, value: A, budget: &Budget, ) -> Result<Self, HostError>
pub fn get(&self, index: usize, budget: &Budget) -> Result<&A, HostError>
pub fn len(&self) -> usize
pub fn push_front(&self, value: A, budget: &Budget) -> Result<Self, HostError>
pub fn pop_front(&self, budget: &Budget) -> Result<Self, HostError>
pub fn push_back(&self, value: A, budget: &Budget) -> Result<Self, HostError>
pub fn pop_back(&self, budget: &Budget) -> Result<Self, HostError>
pub fn remove(&self, idx: usize, budget: &Budget) -> Result<Self, HostError>
pub fn front(&self, budget: &Budget) -> Result<&A, HostError>
pub fn back(&self, budget: &Budget) -> Result<&A, HostError>
pub fn insert( &self, index: usize, value: A, budget: &Budget, ) -> Result<Self, HostError>
pub fn append(&self, other: &Self, budget: &Budget) -> Result<Self, HostError>
pub fn slice( &self, range: Range<usize>, budget: &Budget, ) -> Result<Self, HostError>
pub fn first_index_of<F>( &self, f: F, budget: &Budget, ) -> Result<Option<usize>, HostError>
pub fn last_index_of<F>( &self, f: F, budget: &Budget, ) -> Result<Option<usize>, HostError>
pub fn binary_search_by<F>( &self, cmp: F, budget: &Budget, ) -> Result<Result<usize, usize>, HostError>
pub fn iter(&self) -> Iter<'_, A>
pub fn to_vec(&self, budget: &Budget) -> Result<Vec<A>, HostError>
Trait Implementations§
Source§impl<A: Clone> Clone for MeteredVector<A>
impl<A: Clone> Clone for MeteredVector<A>
Source§fn clone(&self) -> MeteredVector<A>
fn clone(&self) -> MeteredVector<A>
Returns a copy 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 moreSource§impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Budget
impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Budget
Source§impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Host
impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Host
Source§impl<A> Default for MeteredVector<A>
impl<A> Default for MeteredVector<A>
Auto Trait Implementations§
impl<A> Freeze for MeteredVector<A>
impl<A> RefUnwindSafe for MeteredVector<A>where
A: RefUnwindSafe,
impl<A> Send for MeteredVector<A>where
A: Send,
impl<A> Sync for MeteredVector<A>where
A: Sync,
impl<A> Unpin for MeteredVector<A>where
A: Unpin,
impl<A> UnwindSafe for MeteredVector<A>where
A: UnwindSafe,
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, U, V, W, E, C> Compare<(T, U, V, W)> for C
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
Source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.