pub struct SBox<T, S: Sentinel<T> = Null, A: Allocator = Global> { /* private fields */ }
Expand description

An allocated SSlice<T, S> instance.

Implementations

Clones the content of slice into a SBox<T, S>.

Copies the content of slice into a SBox<T, S>.

Turns the provided SBox<T, S> into its raw representation.

The returned pointer can be used to re-construct a box using from_raw_parts.

Constructs a new SBox<T, S> using the provided data pointer and allocator.

Safety

The provided pointer must reference the first element of a SSlice<T, S> instance allocated by allocator.

Clones the content of slice into a SBox<T, S>.

Copies the content of slice into a SBox<T, S>.

Methods from Deref<Target = SSlice<T, S>>

An implementation of fmt::Display and fmt::Debug for the CStr type.

When an invalid character is found, a replacement character is displayed instead.

Returns a pointer to the first element that is part of the slice.

Returns a pointer to the first element that is part of the slice.

Returns an iterator over the elements of the slice.

Returns an iterator over the elements of the slice.

Indexes into this SSlice<T, S> instance without checking the bounds.

Safety

index must be in bounds.

Indexes into this SSlice<T, S> instance without checking the bounds.

Safety

index must be in bounds.

Returns the length of the SSlice<T, S>. This is the number of elements referenced by that instance, not including the terminating sentinel character.

Returns whether the slice is currently empty.

Returns the first element of the slice, or None if it is empty.

Returns the first element of the slice, or None if it is empty.

Returns a pointer to the first element of the slice, and a slice to the remaining elements. None is returned if the slice is empty.

Returns a pointer to the first element of the slice, and a slice to the remaining elements. None is returned if the slice is empty.

Returns a shared reference to the first element of the slice, or a sentinel value if the slice is empty.

Safety

If the returned value is a sentinel, it must not be modified (or rather, it must remain a sentinel).

Returns an exclusive reference to the first element of the slice, or a sentinel value if the slice is empty.

Safety

If the returned value is a sentinel, it must not be modified (or rather, it must remain a sentinel).

Returns a slice referencing every element of this SSlice<T, S>.

Returns a slice referencing every element of this SSlice<T, S>.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

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

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

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

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.