Module konst::slice[][src]

Expand description

const fn equivalents of slice methods.

Modules

cmpcmp

const fns for comparing slices for equality and ordering.

Macros

Tries to convert from &[T] to &[T; N], usable in consts, but not in const fns.

Structs

The error produced by trying to convert from &[T] to &[T; N], or from &mut [T] to &mut [T; N].

Functions

Whether right is inside &left[from..].

A const equivalent of <[u8]>::ends_with

Finds the byte offset of right in left, starting from the from index.

Advances this up to the first instance of needle.

Advances this past the first instance of needle.

Returns whether right is contained inside &left[..=from] searching in reverse.

Finds the byte offset of right inside &left[..=from], searching in reverse.

Truncates this to the last instance of needle.

Truncates this to before the last instance of needle.

A const equivalent of <[u8]>::starts_with

A const equivalent of <[u8]>::strip_prefix

A const equivalent of <[u8]>::strip_suffix

Removes ascii whitespace from the start and end of this.

Removes ascii whitespace from the end of this.

Removes all instances of needle from the end of this.

Removes all instances of needle from the start and end of this.

Removes ascii whitespace from the start of this.

Removes all instances of needle from the start of this.

Compares two &[u8], returning the order of left relative to right.

Compares two Option<&'a [u8]>, returning the ordering of left relative to right.

Compares two &[u8] for equality.

Compares two Option<&'a [u8]> for equality.

A const equivalent of <[T]>::first

first_mutmut_refs or nightly_mut_refs

A const equivalent of <[T]>::first_mut

A const equivalent of slice.get(index)

A const equivalent of slice.get(start..).

get_from_mutmut_refs or nightly_mut_refs

A const equivalent of slice.get_mut(start..).

get_mutmut_refs or nightly_mut_refs

A const equivalent of slice.get_mut(index)

A const equivalent of slice.get(start..end).

get_range_mutmut_refs or nightly_mut_refs

A const equivalent of slice.get_mut(start..end).

A const equivalent of slice.get(..len).

get_up_to_mutmut_refs or nightly_mut_refs

A const equivalent of slice.get_mut(..len).

A const equivalent of <[T]>::last

last_mutmut_refs or nightly_mut_refs

A const equivalent of <[T]>::last_mut

A const equivalent of &slice[start..].

slice_from_mutmut_refs or nightly_mut_refs

A const equivalent of &mut slice[start..].

A const equivalent of &slice[start..end].

slice_range_mutmut_refs or nightly_mut_refs

A const equivalent of &mut slice[start..end].

A const equivalent of &slice[..len].

slice_up_to_mutmut_refs or nightly_mut_refs

A const equivalent of &mut slice[..len].

A const equivalent of <[T]>::split_at

split_at_mutmut_refs and constant_time_slice

A const equivalent of <[T]>::split_at_mut

A const equivalent of <[T]>::split_first

split_first_mutmut_refs or nightly_mut_refs

A const equivalent of <[T]>::split_first_mut

A const equivalent of <[T]>::split_last

split_last_mutmut_refs or nightly_mut_refs

A const equivalent of <[T]>::split_last_mut

Tries to convert from &[T] to &[T; N], usable in const fns. Requires the "rust_1_56" feature.

try_into_array_mutmut_refs or nightly_mut_refs

Tries to convert from &mut [T] to &mut [T; N].