pub struct MetadataValue { /* private fields */ }
Expand description
Represents a [JobCall
] metadata field value.
To handle this, the MetadataValue
is usable as a type and can be compared
with strings and implements Debug
. A to_str
method is provided that returns
an Err
if the metadata value contains non-visible ASCII characters.
Implementations§
Source§impl MetadataValue
impl MetadataValue
Sourcepub fn from_bytes(value: Bytes) -> Self
pub fn from_bytes(value: Bytes) -> Self
Create a new MetadataValue
from a string.
Sourcepub fn from_sensitive_str(value: &str) -> Self
pub fn from_sensitive_str(value: &str) -> Self
Create a new MetadataValue
from a string.
Sourcepub fn from_sensitive_bytes(value: Bytes) -> Self
pub fn from_sensitive_bytes(value: Bytes) -> Self
Create a new MetadataValue
from a string.
Sourcepub fn is_sensitive(&self) -> bool
pub fn is_sensitive(&self) -> bool
Returns true if the metadata value is sensitive.
Sourcepub fn to_str(&self) -> Result<&str, Utf8Error>
pub fn to_str(&self) -> Result<&str, Utf8Error>
Converts the metadata value into a string if it contains valid UTF-8.
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Converts the metadata value into bytes.
pub fn as_bytes(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl AsRef<[u8]> for MetadataValue
impl AsRef<[u8]> for MetadataValue
Source§impl Clone for MetadataValue
impl Clone for MetadataValue
Source§fn clone(&self) -> MetadataValue
fn clone(&self) -> MetadataValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MetadataValue
impl Debug for MetadataValue
Source§impl Default for MetadataValue
impl Default for MetadataValue
Source§fn default() -> MetadataValue
fn default() -> MetadataValue
Source§impl From<&[u8]> for MetadataValue
impl From<&[u8]> for MetadataValue
Source§impl From<&Bytes> for MetadataValue
impl From<&Bytes> for MetadataValue
Source§impl From<&BytesMut> for MetadataValue
impl From<&BytesMut> for MetadataValue
Source§impl From<&String> for MetadataValue
impl From<&String> for MetadataValue
Source§impl From<&i128> for MetadataValue
impl From<&i128> for MetadataValue
Source§impl From<&i16> for MetadataValue
impl From<&i16> for MetadataValue
Source§impl From<&i32> for MetadataValue
impl From<&i32> for MetadataValue
Source§impl From<&i64> for MetadataValue
impl From<&i64> for MetadataValue
Source§impl From<&isize> for MetadataValue
impl From<&isize> for MetadataValue
Source§impl From<&str> for MetadataValue
impl From<&str> for MetadataValue
Source§impl From<&u128> for MetadataValue
impl From<&u128> for MetadataValue
Source§impl From<&u16> for MetadataValue
impl From<&u16> for MetadataValue
Source§impl From<&u32> for MetadataValue
impl From<&u32> for MetadataValue
Source§impl From<&u64> for MetadataValue
impl From<&u64> for MetadataValue
Source§impl From<&usize> for MetadataValue
impl From<&usize> for MetadataValue
Source§impl From<Bytes> for MetadataValue
impl From<Bytes> for MetadataValue
Source§impl From<BytesMut> for MetadataValue
impl From<BytesMut> for MetadataValue
Source§impl From<String> for MetadataValue
impl From<String> for MetadataValue
Source§impl From<i128> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<i128> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<i16> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<i16> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<i32> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<i32> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<i64> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<i64> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<isize> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<isize> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<u128> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<u128> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<u16> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<u16> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<u32> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<u32> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<u64> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<u64> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl From<usize> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
impl From<usize> for MetadataValue
Converts a number into a metadata value by converting it to a big-endian byte array.
Source§impl FromStr for MetadataValue
impl FromStr for MetadataValue
Source§impl TryFrom<&MetadataValue> for i128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for i128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for i16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for i16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for i32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for i32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for i64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for i64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for isize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for isize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for u128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for u128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for u16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for u16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for u32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for u32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for u64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for u64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<&MetadataValue> for usize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<&MetadataValue> for usize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for i128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for i128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for i16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for i16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for i32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for i32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for i64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for i64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for isize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for isize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for u128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for u128
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for u16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for u16
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for u32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for u32
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for u64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for u64
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Source§impl TryFrom<MetadataValue> for usize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.
impl TryFrom<MetadataValue> for usize
Tries to convert a metadata value into a number by parsing it as a big-endian byte array.