pub struct ByteString {
pub value: Option<Vec<u8>>,
}Expand description
A sequence of octets.
Fields§
§value: Option<Vec<u8>>Implementations§
Source§impl ByteString
impl ByteString
Sourcepub fn null() -> ByteString
pub fn null() -> ByteString
Create a null string (not the same as an empty string)
pub fn is_empty(&self) -> bool
Sourcepub fn is_null_or_empty(&self) -> bool
pub fn is_null_or_empty(&self) -> bool
Test if the string is null or empty
Sourcepub fn from_base64(data: &str) -> Option<ByteString>
pub fn from_base64(data: &str) -> Option<ByteString>
Creates a byte string from a Base64 encoded string
Sourcepub fn substring(&self, min: usize, max: usize) -> Result<ByteString, ()>
pub fn substring(&self, min: usize, max: usize) -> Result<ByteString, ()>
This function is meant for use with NumericRange. It creates a substring from this string from min up to and inclusive of max. Note that min must have an index within the string but max is allowed to be beyond the end in which case the remainder of the string is returned (see docs for NumericRange).
Trait Implementations§
Source§impl AsRef<[u8]> for ByteString
impl AsRef<[u8]> for ByteString
Source§impl BinaryEncoder<ByteString> for ByteString
impl BinaryEncoder<ByteString> for ByteString
Source§fn byte_len(&self) -> usize
fn byte_len(&self) -> usize
Returns the exact byte length of the structure as it would be if
encode were called.
This may be called prior to writing to ensure the correct amount of space is available.Source§fn encode<S>(&self, stream: &mut S) -> Result<usize, StatusCode>where
S: Write,
fn encode<S>(&self, stream: &mut S) -> Result<usize, StatusCode>where
S: Write,
Encodes the instance to the write stream.
Source§fn decode<S>(
stream: &mut S,
decoding_options: &DecodingOptions,
) -> Result<ByteString, StatusCode>where
S: Read,
fn decode<S>(
stream: &mut S,
decoding_options: &DecodingOptions,
) -> Result<ByteString, StatusCode>where
S: Read,
Decodes an instance from the read stream. The decoding options contains restrictions set by
the server / client on the length of strings, arrays etc. If these limits are exceeded the
implementation should return with a
BadDecodingError as soon as possible.fn encode_to_vec(&self) -> Vec<u8> ⓘ
Source§impl Clone for ByteString
impl Clone for ByteString
Source§fn clone(&self) -> ByteString
fn clone(&self) -> ByteString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ByteString
impl Debug for ByteString
Source§impl Default for ByteString
impl Default for ByteString
Source§fn default() -> ByteString
fn default() -> ByteString
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ByteString
impl<'de> Deserialize<'de> for ByteString
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ByteString, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ByteString, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, T> From<&'a T> for ByteString
impl<'a, T> From<&'a T> for ByteString
Source§fn from(value: &'a T) -> ByteString
fn from(value: &'a T) -> ByteString
Converts to this type from the input type.
Source§impl From<ByteString> for DataValue
impl From<ByteString> for DataValue
Source§fn from(v: ByteString) -> DataValue
fn from(v: ByteString) -> DataValue
Converts to this type from the input type.
Source§impl From<ByteString> for Identifier
impl From<ByteString> for Identifier
Source§fn from(v: ByteString) -> Identifier
fn from(v: ByteString) -> Identifier
Converts to this type from the input type.
Source§impl From<ByteString> for Variant
impl From<ByteString> for Variant
Source§fn from(v: ByteString) -> Variant
fn from(v: ByteString) -> Variant
Converts to this type from the input type.
Source§impl From<Guid> for ByteString
impl From<Guid> for ByteString
Source§fn from(value: Guid) -> ByteString
fn from(value: Guid) -> ByteString
Converts to this type from the input type.
Source§impl Hash for ByteString
impl Hash for ByteString
Source§impl Into<ByteString> for Thumbprint
impl Into<ByteString> for Thumbprint
Source§fn into(self) -> ByteString
fn into(self) -> ByteString
Converts this type into the (usually inferred) input type.
Source§impl Into<String> for ByteString
impl Into<String> for ByteString
Source§impl PartialEq for ByteString
impl PartialEq for ByteString
Source§impl Serialize for ByteString
impl Serialize for ByteString
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&ByteString> for Guid
impl TryFrom<&ByteString> for Guid
impl Eq for ByteString
impl StructuralPartialEq for ByteString
Auto Trait Implementations§
impl Freeze for ByteString
impl RefUnwindSafe for ByteString
impl Send for ByteString
impl Sync for ByteString
impl Unpin for ByteString
impl UnwindSafe for ByteString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.