Struct soroban_env_host::MeteredVector
source · 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 with_capacity( capacity: usize, budget: &Budget ) -> Result<Self, HostError>
pub fn from_array(buf: &[A], budget: &Budget) -> Result<Self, HostError>
pub fn from_vec(vec: Vec<A>) -> Self
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>where F: Fn(&A) -> Result<Ordering, HostError>,
pub fn last_index_of<F>( &self, f: F, budget: &Budget ) -> Result<Option<usize>, HostError>where F: Fn(&A) -> Result<Ordering, HostError>,
pub fn binary_search_by<F>( &self, cmp: F, budget: &Budget ) -> Result<Result<usize, usize>, HostError>where F: FnMut(&A) -> Result<Ordering, HostError>,
pub fn retain_mut<F>( &mut self, f: F, budget: &Budget ) -> Result<Self, HostError>where F: FnMut(usize, &mut A) -> Result<bool, HostError>,
pub fn iter(&self) -> Iter<'_, A>
pub fn iter_mut(&mut self) -> IterMut<'_, 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 Budgetwhere
Budget: Compare<Elt, Error = HostError>,
impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Budgetwhere Budget: Compare<Elt, Error = HostError>,
Auto Trait Implementations§
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, U, E, C> Compare<(T, U)> for Cwhere
C: Compare<T, Error = E, Error = E> + Compare<U>,
impl<T, U, E, C> Compare<(T, U)> for Cwhere C: Compare<T, Error = E, Error = E> + Compare<U>,
source§impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W>,
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W>,
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 Cwhere
C: Compare<T, Error = E, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W> + Compare<X>,
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W> + Compare<X>,
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>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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.§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.§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.§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.