pub struct List(_);
Expand description
A List type for Bud, which wraps a VecDeque<Value>
.
This type uses a Mutex
for interior mutability, allowing lists to be
cheaply moved around by reference. Each interaction with this type locks the
Mutex.
VecDeque
was chosen to allow users ultimate flexibility in
pushing/popping without worry about performance concerns.
Implementations§
source§impl List
impl List
sourcepub fn into_inner(self) -> VecDeque<Value>
pub fn into_inner(self) -> VecDeque<Value>
Extracts the contained collection type.
sourcepub fn push_front(&self, value: Value)
pub fn push_front(&self, value: Value)
Pushes value
to the front of the list.
Trait Implementations§
source§impl DynamicValue for List
impl DynamicValue for List
source§fn is_truthy(&self) -> bool
fn is_truthy(&self) -> bool
Returns true if the value contained is truthy. See
Value::is_truthy()
for examples of what this means for primitive
types.source§fn kind(&self) -> Symbol
fn kind(&self) -> Symbol
Returns a unique string identifying this type. This returned string will
be wrapped in
ValueKind::Dynamic
when Value::kind()
is invoked
on a dynamic value. Read moresource§fn partial_eq(&self, other: &Value) -> Option<bool>
fn partial_eq(&self, other: &Value) -> Option<bool>
Returns true if self and other are considered equal. Returns false if
self and other are able to be compared but are not equal. Returns None
if the values are unable to be compared. Read more
source§fn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
Returns the relative ordering of
self
and other
, if a comparison is
able to be made. If the types cannot be compared, this function should
return None. Read moresource§fn call(
&self,
name: &Symbol,
args: &mut PoppedValues<'_>
) -> Result<Value, FaultKind>
fn call( &self, name: &Symbol, args: &mut PoppedValues<'_> ) -> Result<Value, FaultKind>
Calls a function by
name
with args
.source§fn to_source(&self) -> Option<String>
fn to_source(&self) -> Option<String>
Returns this value as represented in source, if possible.
source§fn hash<H>(&self, state: &mut H) -> boolwhere
H: Hasher,
fn hash<H>(&self, state: &mut H) -> boolwhere H: Hasher,
Hashes the contents of this value. Returns true if this operation is
supported. Read more
source§fn convert(&self, kind: &Symbol) -> Option<Value>
fn convert(&self, kind: &Symbol) -> Option<Value>
Converts this value to the given kind, if possible. Read more
source§fn checked_add(
&self,
other: &Value,
is_reverse: bool
) -> Result<Option<Value>, FaultKind>
fn checked_add( &self, other: &Value, is_reverse: bool ) -> Result<Option<Value>, FaultKind>
Attempts to compute the result adding self and other. Read more
source§fn checked_sub(
&self,
other: &Value,
is_reverse: bool
) -> Result<Option<Value>, FaultKind>
fn checked_sub( &self, other: &Value, is_reverse: bool ) -> Result<Option<Value>, FaultKind>
Attempts to compute the result subtracting self and other. Read more