Struct starlark::values::string::StarlarkStr[][src]

#[repr(C)]
pub struct StarlarkStr { /* fields omitted */ }
Expand description

A pointer to this type represents a Starlark string. Use of this type is discouraged and not considered stable.

Implementations

Trait Implementations

Must return the TypeId of Self but where the lifetimes are changed to 'static. Must be consistent with static_type_of. Read more

Must return the TypeId of Self but where the lifetimes are changed to 'static. Must be consistent with static_type_id. Must not consult the self parameter in any way. Read more

Formats the value using the given formatter. Read more

Return a string describing the type of self, as returned by the type() function. Read more

Like get_type, but returns a reusable FrozenValue pointer to it. This function deliberately doesn’t take a heap, as it would not be performant to allocate a new value each time. Read more

Get the members associated with this type, accessible via this_type.x. These members will have dir/getattr/hasattr properly implemented, so it is the preferred way to go if possible. See GlobalsStatic for an example of how to define this method. Read more

Return a string representation of self, as returned by the repr() function. Defaults to the Debug instance, but most types should override this method. In many cases the repr() representation will also be a Starlark expression for creating the value. Read more

Convert the type to a JSON string.

Convert self to a boolean, as returned by the bool() function. The default implementation returns true. Read more

Return a hash code for self to be used when self is placed as a key in a Dict. Return an Err if there is no hash for this value (e.g. list). Must be stable between frozen and non-frozen values. Read more

Compare self with other for equality. Should only return an error on excessive recursion. Read more

Compare self with other. This method returns a result of type Ordering, or an Err if the two types differ. Read more

Return the result of a[index] if a is indexable.

Returns the length of the value, if this value is a sequence.

Tell wether other is in the current value, if it is a container. Read more

Extract a slice of the underlying object if the object is indexable. The result will be object between start and stop (both of them are added length() if negative and then clamped between 0 and length()). stride indicates the direction. Read more

Add other to the current value. Pass both self and the Value form of self as original. Read more

Multiply the current value with other. Read more

Apply the percent operator between the current value and other. Usually used on strings, as per the Starlark spec. Read more

Is this value a match for a named type. Usually returns true for values matching get_type, but might also work for subtypes it implements. Read more

Return structured documentation for self, if available.

Convert self to a integer value, as returned by the int() function if the type is numeric (not for string). Works for int and bool (0 = false, 1 = true). Read more

Directly invoke a function. The number of named and names arguments are guaranteed to be equal. A direct implementation is responsible for calling Evaluator::with_call_stack to ensure the call stack is properly updated. Read more

Returns an iterable over the value of this container if this value holds an iterable container. Read more

Call a function with the same iterator as would be returned from iterate. The one advantage is that the iterator does not need to be allocated in a Box. If you implement this function you must also implement iterate, but the reverse is not true (this function has a sensible default). Read more

Get an attribute for the current value as would be returned by dotted expression (i.e. a.attribute). Read more

Return true if an attribute of name attribute exists for the current value. Read more

Return a vector of string listing all attribute of the current value. Read more

Apply the + unary operator to the current value. Read more

Apply the - unary operator to the current value. Read more

Add with the arguments the other way around. Should return None to fall through to normal add. Read more

Substract other from the current value. Read more

Floor division between the current value and other. Read more

Bitwise & operator.

Bitwise | operator.

Bitwise ^ operator.

Bitwise << operator.

Bitwise >> operator.

Called when exporting a value under a specific name,

Set the value at index with the new value. Read more

Set the attribute named attribute of the current value to value (e.g. a.attribute = value). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Get an ARef pointing at this type.

Try and get an ARef pointing at this type. Returns an Err if the type Self is a RefCell which is already mutably borrowed. Read more

Return the underlying RefCell if Self is one, otherwise None.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert between two equal types.

Convert between references to two equal types.

Convert between mutable references to two equal types.

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.