Struct soroban_env_host::MeteredVector
source · pub struct MeteredVector<A> { /* private fields */ }Implementations§
source§impl<A: Clone> MeteredVector<A>
impl<A: Clone> MeteredVector<A>
pub fn new(budget: Budget) -> Result<Self, HostError>
pub fn from_array<const N: usize>(
budget: Budget,
buf: [A; N]
) -> Result<Self, HostError>
pub fn from_vec(budget: Budget, vec: Vector<A>) -> Result<Self, HostError>
pub fn set(&mut self, index: usize, value: A) -> Result<A, HostError>
pub fn get(&self, index: usize) -> Result<&A, HostError>
pub fn get_mut(&mut self, index: usize) -> Result<&mut A, HostError>
pub fn remove(&mut self, index: usize) -> Result<A, HostError>
pub fn len(&self) -> usize
pub fn push_front(&mut self, value: A) -> Result<(), HostError>
pub fn pop_front(&mut self) -> Result<A, HostError>
pub fn push_back(&mut self, value: A) -> Result<(), HostError>
pub fn pop_back(&mut self) -> Result<A, HostError>
pub fn front(&self) -> Result<&A, HostError>
pub fn back(&self) -> Result<&A, HostError>
pub fn insert(&mut self, index: usize, value: A) -> Result<(), HostError>
pub fn append(&mut self, other: Self) -> Result<(), HostError>
pub fn slice<R>(&mut self, range: R) -> Result<Self, HostError>where
R: RangeBounds<usize>,
sourcepub fn first_index_of(&self, value: &A) -> Result<Option<usize>, HostError>where
A: PartialEq,
pub fn first_index_of(&self, value: &A) -> Result<Option<usize>, HostError>where
A: PartialEq,
Time: O(n)
sourcepub fn last_index_of(&self, value: &A) -> Result<Option<usize>, HostError>where
A: PartialEq,
pub fn last_index_of(&self, value: &A) -> Result<Option<usize>, HostError>where
A: PartialEq,
Time: O(n)
Trait Implementations§
source§impl<A: Clone> Clone for MeteredVector<A>
impl<A: Clone> Clone for MeteredVector<A>
source§impl<A: Clone + Ord> Ord for MeteredVector<A>
impl<A: Clone + Ord> Ord for MeteredVector<A>
source§impl<A: Clone + PartialEq> PartialEq<MeteredVector<A>> for MeteredVector<A>
impl<A: Clone + PartialEq> PartialEq<MeteredVector<A>> for MeteredVector<A>
source§impl<A: Clone + PartialOrd> PartialOrd<MeteredVector<A>> for MeteredVector<A>
impl<A: Clone + PartialOrd> PartialOrd<MeteredVector<A>> for MeteredVector<A>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<A: Clone + Eq> Eq for MeteredVector<A>
Auto Trait Implementations§
impl<A> !RefUnwindSafe for MeteredVector<A>
impl<A> !Send for MeteredVector<A>
impl<A> !Sync for MeteredVector<A>
impl<A> Unpin for MeteredVector<A>where
A: Unpin,
impl<A> !UnwindSafe for MeteredVector<A>
Blanket Implementations§
§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. Read more§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. Read more§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. Read more§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. Read more