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 nothing.

Returns true if the value is NaN (Not a Number).

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:

  1. bool returns itself.
  2. int returns true for any non-zero value; otherwise, false.
  3. float returns true for any normal value; otherwise, false.
  4. empty returns false.
  5. Collections that can be zero-length (string, list, map, range) return true if their length is nonzero; otherwise, false.
  6. All other types return true.

Gets the length of the value.

Returns true if the length of the value is 0.

Returns a shallow copy of the value.

Gets the Rant type associated with the value.

Gets the type name of 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

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

This method tests greater than or equal to (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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.