pub struct MeteredVector<A>where
    A: MeteredClone,{ /* private fields */ }

Implementations§

source§

impl<A> MeteredVector<A>where A: MeteredClone,

source

pub fn new(budget: &Budget) -> Result<Self, HostError>

source

pub fn with_capacity( capacity: usize, budget: &Budget ) -> Result<Self, HostError>

source

pub fn from_array(buf: &[A], budget: &Budget) -> Result<Self, HostError>

source

pub fn from_vec(vec: Vec<A>, budget: &Budget) -> Result<Self, HostError>

source

pub fn as_slice(&self) -> &[A]

source

pub fn from_exact_iter<I: Iterator<Item = A>>( iter: I, budget: &Budget ) -> Result<Self, HostError>

source

pub fn set( &self, index: usize, value: A, budget: &Budget ) -> Result<Self, HostError>

source

pub fn get(&self, index: usize, budget: &Budget) -> Result<&A, HostError>

source

pub fn len(&self) -> usize

source

pub fn push_front(&self, value: A, budget: &Budget) -> Result<Self, HostError>

source

pub fn pop_front(&self, budget: &Budget) -> Result<Self, HostError>

source

pub fn push_back(&self, value: A, budget: &Budget) -> Result<Self, HostError>

source

pub fn pop_back(&self, budget: &Budget) -> Result<Self, HostError>

source

pub fn remove(&self, idx: usize, budget: &Budget) -> Result<Self, HostError>

source

pub fn front(&self, budget: &Budget) -> Result<&A, HostError>

source

pub fn back(&self, budget: &Budget) -> Result<&A, HostError>

source

pub fn insert( &self, index: usize, value: A, budget: &Budget ) -> Result<Self, HostError>

source

pub fn append(&self, other: &Self, budget: &Budget) -> Result<Self, HostError>

source

pub fn slice( &self, range: Range<usize>, budget: &Budget ) -> Result<Self, HostError>

source

pub fn first_index_of<F>( &self, f: F, budget: &Budget ) -> Result<Option<usize>, HostError>where F: Fn(&A) -> Result<Ordering, HostError>,

source

pub fn last_index_of<F>( &self, f: F, budget: &Budget ) -> Result<Option<usize>, HostError>where F: Fn(&A) -> Result<Ordering, HostError>,

source

pub fn binary_search_by<F>( &self, cmp: F, budget: &Budget ) -> Result<Result<usize, usize>, HostError>where F: FnMut(&A) -> Result<Ordering, HostError>,

source

pub fn retain_mut<F>( &mut self, f: F, budget: &Budget ) -> Result<Self, HostError>where F: FnMut(usize, &mut A) -> Result<bool, HostError>,

source

pub fn iter(&self) -> Iter<'_, A>

source

pub fn iter_mut(&mut self) -> IterMut<'_, A>

Trait Implementations§

source§

impl<A> Clone for MeteredVector<A>where A: MeteredClone + Clone,

source§

fn clone(&self) -> MeteredVector<A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Budgetwhere Budget: Compare<Elt, Error = HostError>,

§

type Error = HostError

source§

fn compare( &self, a: &MeteredVector<Elt>, b: &MeteredVector<Elt> ) -> Result<Ordering, Self::Error>

source§

impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Hostwhere Host: Compare<Elt, Error = HostError>,

§

type Error = HostError

source§

fn compare( &self, a: &MeteredVector<Elt>, b: &MeteredVector<Elt> ) -> Result<Ordering, Self::Error>

source§

impl<A> Default for MeteredVector<A>where A: MeteredClone + Default,

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, C> Compare<&T> for Cwhere C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(&self, a: &&T, b: &&T) -> Result<Ordering, <C as Compare<&T>>::Error>

source§

impl<T, U, E, C> Compare<(T, U)> for Cwhere C: Compare<T, Error = E, Error = E> + Compare<U>,

§

type Error = E

source§

fn compare( &self, a: &(T, U), b: &(T, U) ) -> Result<Ordering, <C as Compare<(T, U)>>::Error>

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>,

§

type Error = E

source§

fn compare( &self, a: &(T, U, V), b: &(T, U, V) ) -> Result<Ordering, <C as Compare<(T, U, V)>>::Error>

source§

impl<T, C> Compare<Box<T, Global>> for Cwhere C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare( &self, a: &Box<T, Global>, b: &Box<T, Global> ) -> Result<Ordering, <C as Compare<Box<T, Global>>>::Error>

source§

impl<T, C> Compare<Option<T>> for Cwhere C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare( &self, a: &Option<T>, b: &Option<T> ) -> Result<Ordering, <C as Compare<Option<T>>>::Error>

source§

impl<T, C> Compare<Rc<T>> for Cwhere C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare( &self, a: &Rc<T>, b: &Rc<T> ) -> Result<Ordering, <C as Compare<Rc<T>>>::Error>

source§

impl<T, C> Compare<Vec<T, Global>> for Cwhere C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare( &self, a: &Vec<T, Global>, b: &Vec<T, Global> ) -> Result<Ordering, <C as Compare<Vec<T, Global>>>::Error>

§

impl<T> Downcast for Twhere T: Any,

§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync + 'static>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<E, T, U> TryIntoVal<E, T> for Uwhere E: Env, T: TryFromVal<E, U>,

§

type Error = <T as TryFromVal<E, U>>::Error

source§

fn try_into_val(&self, env: &E) -> Result<T, <U as TryIntoVal<E, T>>::Error>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V