Type Alias sqlx_oldapi::types::uuid::Bytes

source ·
pub type Bytes = [u8; 16];
Expand description

A 128-bit (16 byte) buffer containing the UUID.

ABI

The Bytes type is always guaranteed to be have the same ABI as Uuid.

Trait Implementations§

§

impl<const N: usize> ByteSlice for [u8; N]

§

fn as_bstr(&self) -> &BStr

Return this byte slice as a &BStr. Read more
§

fn as_bstr_mut(&mut self) -> &mut BStr

Return this byte slice as a &mut BStr. Read more
§

fn from_os_str(os_str: &OsStr) -> Option<&[u8]>

Create an immutable byte string from an OS string slice. Read more
§

fn from_path(path: &Path) -> Option<&[u8]>

Create an immutable byte string from a file path. Read more
§

fn to_str(&self) -> Result<&str, Utf8Error>

Safely convert this byte string into a &str if it’s valid UTF-8. Read more
§

unsafe fn to_str_unchecked(&self) -> &str

Unsafely convert this byte string into a &str, without checking for valid UTF-8. Read more
§

fn to_str_lossy(&self) -> Cow<'_, str>

Convert this byte string to a valid UTF-8 string by replacing invalid UTF-8 bytes with the Unicode replacement codepoint (U+FFFD). Read more
§

fn to_str_lossy_into(&self, dest: &mut String)

Copy the contents of this byte string into the given owned string buffer, while replacing invalid UTF-8 code unit sequences with the Unicode replacement codepoint (U+FFFD). Read more
§

fn to_os_str(&self) -> Result<&OsStr, Utf8Error>

Create an OS string slice from this byte string. Read more
§

fn to_os_str_lossy(&self) -> Cow<'_, OsStr>

Lossily create an OS string slice from this byte string. Read more
§

fn to_path(&self) -> Result<&Path, Utf8Error>

Create a path slice from this byte string. Read more
§

fn to_path_lossy(&self) -> Cow<'_, Path>

Lossily create a path slice from this byte string. Read more
§

fn repeatn(&self, n: usize) -> Vec<u8, Global> ⓘ

Create a new byte string by repeating this byte string n times. Read more
§

fn contains_str<B>(&self, needle: B) -> boolwhere B: AsRef<[u8]>,

Returns true if and only if this byte string contains the given needle. Read more
§

fn starts_with_str<B>(&self, prefix: B) -> boolwhere B: AsRef<[u8]>,

Returns true if and only if this byte string has the given prefix. Read more
§

fn ends_with_str<B>(&self, suffix: B) -> boolwhere B: AsRef<[u8]>,

Returns true if and only if this byte string has the given suffix. Read more
§

fn find<B>(&self, needle: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the first occurrence of the given needle. Read more
§

fn rfind<B>(&self, needle: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the last occurrence of the given needle. Read more
§

fn find_iter<B, 'h, 'n>(&'h self, needle: &'n B) -> Find<'h, 'n>where B: AsRef<[u8]> + ?Sized,

Returns an iterator of the non-overlapping occurrences of the given needle. The iterator yields byte offset positions indicating the start of each match. Read more
§

fn rfind_iter<B, 'h, 'n>(&'h self, needle: &'n B) -> FindReverse<'h, 'n>where B: AsRef<[u8]> + ?Sized,

Returns an iterator of the non-overlapping occurrences of the given needle in reverse. The iterator yields byte offset positions indicating the start of each match. Read more
§

fn find_byte(&self, byte: u8) -> Option<usize>

Returns the index of the first occurrence of the given byte. If the byte does not occur in this byte string, then None is returned. Read more
§

fn rfind_byte(&self, byte: u8) -> Option<usize>

Returns the index of the last occurrence of the given byte. If the byte does not occur in this byte string, then None is returned. Read more
§

fn find_char(&self, ch: char) -> Option<usize>

Returns the index of the first occurrence of the given codepoint. If the codepoint does not occur in this byte string, then None is returned. Read more
§

fn rfind_char(&self, ch: char) -> Option<usize>

Returns the index of the last occurrence of the given codepoint. If the codepoint does not occur in this byte string, then None is returned. Read more
§

fn find_byteset<B>(&self, byteset: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the first occurrence of any of the bytes in the provided set. Read more
§

fn find_not_byteset<B>(&self, byteset: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the first occurrence of a byte that is not a member of the provided set. Read more
§

fn rfind_byteset<B>(&self, byteset: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the last occurrence of any of the bytes in the provided set. Read more
§

fn rfind_not_byteset<B>(&self, byteset: B) -> Option<usize>where B: AsRef<[u8]>,

Returns the index of the last occurrence of a byte that is not a member of the provided set. Read more
§

fn fields_with<F>(&self, f: F) -> FieldsWith<'_, F>where F: FnMut(char) -> bool,

Returns an iterator over the fields in a byte string, separated by contiguous codepoints satisfying the given predicate. Read more
§

fn split_str<B, 'h, 's>(&'h self, splitter: &'s B) -> Split<'h, 's>where B: AsRef<[u8]> + ?Sized,

Returns an iterator over substrings of this byte string, separated by the given byte string. Each element yielded is guaranteed not to include the splitter substring. Read more
§

fn rsplit_str<B, 'h, 's>(&'h self, splitter: &'s B) -> SplitReverse<'h, 's>where B: AsRef<[u8]> + ?Sized,

Returns an iterator over substrings of this byte string, separated by the given byte string, in reverse. Each element yielded is guaranteed not to include the splitter substring. Read more
§

fn split_once_str<B, 'a>(&'a self, splitter: &B) -> Option<(&'a [u8], &'a [u8])>where B: AsRef<[u8]> + ?Sized,

Split this byte string at the first occurrence of splitter. Read more
§

fn rsplit_once_str<B, 'a>( &'a self, splitter: &B ) -> Option<(&'a [u8], &'a [u8])>where B: AsRef<[u8]> + ?Sized,

Split this byte string at the last occurrence of splitter. Read more
§

fn splitn_str<B, 'h, 's>( &'h self, limit: usize, splitter: &'s B ) -> SplitN<'h, 's>where B: AsRef<[u8]> + ?Sized,

Returns an iterator of at most limit substrings of this byte string, separated by the given byte string. If limit substrings are yielded, then the last substring will contain the remainder of this byte string. Read more
§

fn rsplitn_str<B, 'h, 's>( &'h self, limit: usize, splitter: &'s B ) -> SplitNReverse<'h, 's>where B: AsRef<[u8]> + ?Sized,

Returns an iterator of at most limit substrings of this byte string, separated by the given byte string, in reverse. If limit substrings are yielded, then the last substring will contain the remainder of this byte string. Read more
§

fn replace<N, R>(&self, needle: N, replacement: R) -> Vec<u8, Global> ⓘwhere N: AsRef<[u8]>, R: AsRef<[u8]>,

Replace all matches of the given needle with the given replacement, and the result as a new Vec<u8>. Read more
§

fn replacen<N, R>( &self, needle: N, replacement: R, limit: usize ) -> Vec<u8, Global> ⓘwhere N: AsRef<[u8]>, R: AsRef<[u8]>,

Replace up to limit matches of the given needle with the given replacement, and the result as a new Vec<u8>. Read more
§

fn replace_into<N, R>( &self, needle: N, replacement: R, dest: &mut Vec<u8, Global> )where N: AsRef<[u8]>, R: AsRef<[u8]>,

Replace all matches of the given needle with the given replacement, and write the result into the provided Vec<u8>. Read more
§

fn replacen_into<N, R>( &self, needle: N, replacement: R, limit: usize, dest: &mut Vec<u8, Global> )where N: AsRef<[u8]>, R: AsRef<[u8]>,

Replace up to limit matches of the given needle with the given replacement, and write the result into the provided Vec<u8>. Read more
§

fn bytes(&self) -> Bytes<'_>

Returns an iterator over the bytes in this byte string. Read more
§

fn chars(&self) -> Chars<'_>

Returns an iterator over the Unicode scalar values in this byte string. If invalid UTF-8 is encountered, then the Unicode replacement codepoint is yielded instead. Read more
§

fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the Unicode scalar values in this byte string along with their starting and ending byte index positions. If invalid UTF-8 is encountered, then the Unicode replacement codepoint is yielded instead. Read more
§

fn utf8_chunks(&self) -> Utf8Chunks<'_>

Iterate over chunks of valid UTF-8. Read more
§

fn lines(&self) -> Lines<'_>

An iterator over all lines in a byte string, without their terminators. Read more
§

fn lines_with_terminator(&self) -> LinesWithTerminator<'_>

An iterator over all lines in a byte string, including their terminators. Read more
§

fn trim_with<F>(&self, trim: F) -> &[u8] ⓘwhere F: FnMut(char) -> bool,

Return a byte string slice with leading and trailing characters satisfying the given predicate removed. Read more
§

fn trim_start_with<F>(&self, trim: F) -> &[u8] ⓘwhere F: FnMut(char) -> bool,

Return a byte string slice with leading characters satisfying the given predicate removed. Read more
§

fn trim_end_with<F>(&self, trim: F) -> &[u8] ⓘwhere F: FnMut(char) -> bool,

Return a byte string slice with trailing characters satisfying the given predicate removed. Read more
§

fn to_ascii_lowercase(&self) -> Vec<u8, Global> ⓘ

Returns a new Vec<u8> containing the ASCII lowercase equivalent of this byte string. Read more
§

fn make_ascii_lowercase(&mut self)

Convert this byte string to its lowercase ASCII equivalent in place. Read more
§

fn to_ascii_uppercase(&self) -> Vec<u8, Global> ⓘ

Returns a new Vec<u8> containing the ASCII uppercase equivalent of this byte string. Read more
§

fn make_ascii_uppercase(&mut self)

Convert this byte string to its uppercase ASCII equivalent in place. Read more
§

fn escape_bytes(&self) -> EscapeBytes<'_>

Escapes this byte string into a sequence of char values. Read more
§

fn reverse_bytes(&mut self)

Reverse the bytes in this string, in place. Read more
§

fn reverse_chars(&mut self)

Reverse the codepoints in this string, in place. Read more
§

fn is_ascii(&self) -> bool

Returns true if and only if every byte in this byte string is ASCII. Read more
§

fn is_utf8(&self) -> bool

Returns true if and only if the entire byte string is valid UTF-8. Read more
§

fn last_byte(&self) -> Option<u8>

Returns the last byte in this byte string, if it’s non-empty. If this byte string is empty, this returns None. Read more
§

fn find_non_ascii_byte(&self) -> Option<usize>

Returns the index of the first non-ASCII byte in this byte string (if any such indices exist). Specifically, it returns the index of the first byte with a value greater than or equal to 0x80. Read more
source§

impl<const N: usize> Decode<'_, Postgres> for [u8; N]

source§

fn decode( value: PgValueRef<'_> ) -> Result<[u8; N], Box<dyn Error + Send + Sync, Global>>

Decode a new value of this type using a raw value from the database.
source§

impl<'r, T, const N: usize> Decode<'r, Postgres> for [T; N]where T: for<'a> Decode<'a, Postgres> + Type<Postgres>,

source§

fn decode( value: PgValueRef<'r> ) -> Result<[T; N], Box<dyn Error + Send + Sync, Global>>

Decode a new value of this type using a raw value from the database.
source§

impl<const N: usize> Encode<'_, Postgres> for [u8; N]

source§

fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull

Writes the value of self into buf without moving self. Read more
source§

fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere Self: Sized,

Writes the value of self into buf in the expected format for the database.
source§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

source§

fn size_hint(&self) -> usize

source§

impl<'q, T, const N: usize> Encode<'q, Postgres> for [T; N]where &'a [T]: for<'a> Encode<'q, Postgres>, T: Encode<'q, Postgres>,

source§

fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull

Writes the value of self into buf without moving self. Read more
source§

fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere Self: Sized,

Writes the value of self into buf in the expected format for the database.
source§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

source§

fn size_hint(&self) -> usize

source§

impl<const N: usize> PgHasArrayType for [u8; N]

source§

impl<T, const N: usize> Type<Postgres> for [T; N]where T: PgHasArrayType,

source§

fn type_info() -> PgTypeInfo

Returns the canonical SQL type for this Rust type. Read more
source§

fn compatible(ty: &PgTypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more