Struct rant::RantOrderedCollection
source · [−]pub struct RantOrderedCollection(_);
Expand description
Filter type that represents any indexable (ordered) Rant collection type.
Use on native functions to accept any ordered collection type. Derefs to RantValue
.
Methods from Deref<Target = RantValue>
Returns true if the value is of type empty
.
Returns true if the value is callable (e.g. a function).
Interprets this value as a boolean value according to Rant’s truthiness rules.
Types are converted as follows:
bool
returns itself.int
returnstrue
for any non-zero value; otherwise,false
.float
returnstrue
for any normal value; otherwise,false
.empty
returnsfalse
.- Collections that can be zero-length (
string
,list
,map
,range
) returntrue
if their length is nonzero; otherwise,false
. - All other types return
true
.
Returns a shallow copy of the value.
Gets the Rant type associated with the value.
Indicates whether the value can be indexed into.
Attempts to get a value by index.
Attempts to get a value by key.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Convert from a RantValue
.
Returns true
if the type can be used to represent an optional Rant parameter in native functions; otherwise, false
.
Auto Trait Implementations
impl !RefUnwindSafe for RantOrderedCollection
impl !Send for RantOrderedCollection
impl !Sync for RantOrderedCollection
impl Unpin for RantOrderedCollection
impl !UnwindSafe for RantOrderedCollection
Blanket Implementations
Mutably borrows from an owned value. Read more