#[repr(C)]
pub struct RelString<A: RawRegionalAllocator, B: Basis = DefaultBasis> { /* private fields */ }
Expand description

A relative counterpart to String.

Implementations

Returns a reference to the underlying allocator.

Returns a bytes slice of this RelString’s contents.

Returns a string slice of the RelString’s contents.

Returns a mutable reference to the contents of this RelString.

Safety

The returned Mut<'_, RelVec<u8, A, B>> allows writing bytes which are not valid UTF-8. If this constraint is violated, using the original RelString after dropping the Mut may violate memory safety, as other code may assume that RelStrings only contain valid UTF-8.

Returns a mutable string slice of the RelString’s contents.

Returns this RelString’s capacity, in bytes.

Truncates this RelString, removing all contents.

While this means the String will have a length of zero, it does not affect its capacity.

Returns the length of this RelString, in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.

Returns whether this RelString is empty.

Trait Implementations

Formats the value using the given formatter.
The resulting type after dereferencing.
Dereferences the value.
Formats the value using the given formatter.
Drops the value pointed to by this. Read more
Returns the metadata of the T that this emplaces. Read more
Emplaces a value into a given slot within some memory region. Read more
Moves a value into a given slot within some memory region. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
The metadata associated with the pointee in the chosen basis.
An error occurred while converting metadata from the native representation. Read more
An error occurred while converting metadata to the native representation. Read more
Returns the pointer metadata in B corresponding to the given native pointer metadata, or Err if the conversion failed. Read more
Returns the native pointer metadata corresponding to the given pointer metadata in B, or Err if the conversion failed. 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.

Moves a value into a given slot within some memory region. Read more
Moves a Sized value into a given slot within some memory region.
Moves a Sized value into a given slot within some memory region. Read more
The type for metadata in pointers and references to Self.
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.