Skip to main content

List

Struct List 

Source
pub struct List<T> { /* private fields */ }

Implementations§

Source§

impl<T> List<T>
where T: State,

Source

pub const fn empty() -> List<T>

Source

pub fn get(&self, index: usize) -> Option<&Value<T>>

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut Value<T>>

Source

pub fn iter(&self) -> impl Iterator<Item = &Value<T>>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Value<T>>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<T> AnyList for List<T>
where T: State,

Source§

fn lookup(&self, index: usize) -> Option<PendingValue>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

impl<T> Debug for List<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for List<T>
where T: State,

Source§

fn default() -> List<T>

Returns the “default value” for a type. Read more
Source§

impl<T> FromIterator<T> for List<T>
where T: State,

Source§

fn from_iter<I>(iter: I) -> List<T>
where I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
Source§

impl<T> State for List<T>
where T: State,

Source§

fn type_info(&self) -> Type

Source§

fn as_any_list(&self) -> Option<&(dyn AnyList + 'static)>

Source§

fn as_int(&self) -> Option<i64>

Source§

fn as_float(&self) -> Option<f64>

Source§

fn as_hex(&self) -> Option<Hex>

Source§

fn as_color(&self) -> Option<Color>

Source§

fn as_char(&self) -> Option<char>

Source§

fn as_str(&self) -> Option<&str>

Source§

fn as_bool(&self) -> Option<bool>

Source§

fn as_any_map(&self) -> Option<&(dyn AnyMap + 'static)>

Source§

fn as_maybe(&self) -> Option<&dyn AnyMaybe>

Source§

impl<T> TypeId for List<T>

Source§

const TYPE: Type = Type::List

Auto Trait Implementations§

§

impl<T> Freeze for List<T>

§

impl<T> RefUnwindSafe for List<T>
where T: RefUnwindSafe,

§

impl<T> !Send for List<T>

§

impl<T> !Sync for List<T>

§

impl<T> Unpin for List<T>

§

impl<T> UnsafeUnpin for List<T>

§

impl<T> UnwindSafe for List<T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.