Struct soroban_env_host::MeteredVector
source · pub struct MeteredVector<A>where
A: MeteredClone,{ /* private fields */ }
Implementations§
source§impl<A> MeteredVector<A>where
A: MeteredClone,
impl<A> MeteredVector<A>where A: MeteredClone,
pub fn new(budget: &Budget) -> Result<Self, HostError>
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>, budget: &Budget) -> Result<Self, HostError>
pub fn as_slice(&self) -> &[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>
Trait Implementations§
source§impl<A> Clone for MeteredVector<A>where
A: MeteredClone + Clone,
impl<A> Clone for MeteredVector<A>where A: MeteredClone + Clone,
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>,
source§impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Hostwhere
Host: Compare<Elt, Error = HostError>,
impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Hostwhere Host: Compare<Elt, Error = HostError>,
source§impl<A> Default for MeteredVector<A>where
A: MeteredClone + Default,
impl<A> Default for MeteredVector<A>where A: MeteredClone + Default,
source§fn default() -> MeteredVector<A>
fn default() -> MeteredVector<A>
Returns the “default value” for a type. Read more
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, 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>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, 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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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.