Struct basic_text::TextSubstr[][src]

#[repr(transparent)]
pub struct TextSubstr(_);
Expand description

Text substring slices.

TextSubstr is to TextSubstring as TextStr is to TextString. It is usually used for borrowing, in the form of &TextSubstr.

Implementations

Converts a slice of bytes to a text string slice.

Converts a string slice to a text string slice.

Converts a mutable slice of bytes to a mutable text string slice.

Converts a mutable string slice to a mutable text string slice.

Converts a slice of bytes to a text string slice without checking that the string contains valid Basic Text.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Converts a string slice to a text string slice without checking that the string contains valid Basic Text.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Converts a slice of bytes to a text string slice without checking that the string contains valid Basic Text; mutable version.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Converts a string slice to a text string slice without checking that the string contains valid Basic Text; mutable version.

Safety

This function is unsafe because it does not check that the string passed to it is valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Converts a boxed slice of bytes to a boxed text string slice without checking that the string contains valid basic text.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Converts a boxed string slice to a boxed text string slice without checking that the string contains valid basic text.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid Basic Text. If this constraint is violated, undefined behavior results, as the rest of this crate assumes that &TextSubstrs are valid Basic Text.

Returns the length of self.

Returns true if self has a length of zero bytes.

Converts a text string slice to a byte slice.

Converts a mutable text string slice to a mutable byte slice.

Safety

The caller must ensure that the content of the slice is valid Basic Text before the borrow ends and the underlying TextSubstr is used.

Use of a TextSubstr whose contents are not valid Basic Text is undefined behavior.

Converts a text string slice to a raw pointer.

Converts a mutable text string slice to a raw pointer.

Extracts a UTF-8 string slice containing the entire TextSubstr.

Divide one text string slice into two at an index.

Divide one mutable text string slice into two at an index.

Returns an iterator over the chars of a text string slice.

Returns an iterator over the chars of a text string slice, and their positions.

An iterator over the bytes of a text string slice.

An iterator over the lines of a text string, as text string slices.

TODO: There should be a TextLines which yields &TextSubstrs.

Returns an iterator of u16 over the string encoded as Basic Text.

Returns true if the given pattern matches a sub-slice of this text string slice.

Returns false if it does not.

Returns true if the given pattern matches a prefix of this text string slice.

Returns false if it does not.

Returns true if the given pattern matches a suffix of this text string slice.

Returns false if it does not.

Returns the byte index of the first character of this text string slice that matches the pattern.

Returns None if the pattern doesn’t match.

Returns the byte index for the first character of the rightmost match of the pattern in this text string slice.

Returns None if the pattern doesn’t match.

An iterator over the disjoint matches of a pattern within the given text string slice.

TODO: There should be a TextMatches which yields &TextSubstrs.

An iterator over the disjoint matches of a pattern within this text string slice, yielded in reverse order.

TODO: There should be a TextRMatches which yields &TextSubstrs.

An iterator over the disjoint matches of a pattern within this text string slice as well as the index that the match starts at.

TODO: There should be a TextMatchIndices which yields &TextSubstrs.

An iterator over the disjoint matches of a pattern within self, yielded in reverse order along with the index of the match.

TODO: There should be a TextRMatchIndices which yields &TextSubstrs.

Returns a text string slice with leading and trailing whitespace removed.

Returns a text string slice with leading whitespace removed.

Returns a text string slice with trailing whitespace removed.

Parses this text string slice into another type.

Checks if all characters in this text string are within the ASCII range.

Checks that two text strings are an ASCII case-insensitive match.

Converts a Box<TextSubstr> into a Box<[u8]> without copying or allocating.

Converts a Box<TextSubstr> into a Box<str> without copying or allocating.

Converts a Box<TextSubstr> into a String without copying or allocating.

Converts a Box<TextSubstr> into a TextSubstring without copying or allocating.

Creates a new TextSubstring by repeating a string n times.

Return an iterator that escapes each char in self with char::escape_debug.

Return an iterator that escapes each char in self with char::escape_default.

Return an iterator that escapes each char in self with char::escape_unicode.

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. 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 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 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 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 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 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 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

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)

recently added

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

Returned iterator over socket addresses which this type may correspond to. Read more

Converts this object to an iterator of resolved SocketAddrs. 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

Converts the given value to a String. Read more