pub struct ByteString {
pub value: Option<Vec<u8>>,
}Expand description
A sequence of octets.
Fields§
§value: Option<Vec<u8>>Raw inner byte string values as an array of bytes.
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)
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Test if the bytestring has an empty value (not the same as null)
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 from_base64_ignore_whitespace(data: String) -> Option<ByteString>
pub fn from_base64_ignore_whitespace(data: String) -> Option<ByteString>
Creates a byte string from a base64 encoded string, ignoring whitespace.
Sourcepub fn substring(
&self,
min: usize,
max: usize,
) -> Result<ByteString, OutOfRange>
pub fn substring( &self, min: usize, max: usize, ) -> Result<ByteString, OutOfRange>
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 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§impl<'a, T> From<&'a T> for ByteString
impl<'a, T> From<&'a T> for ByteString
Source§impl From<ByteString> for DataValue
impl From<ByteString> for DataValue
Source§fn from(v: ByteString) -> Self
fn from(v: ByteString) -> Self
Converts to this type from the input type.
Source§impl From<ByteString> for Identifier
impl From<ByteString> for Identifier
Source§fn from(v: ByteString) -> Self
fn from(v: ByteString) -> Self
Converts to this type from the input type.
Source§impl From<ByteString> for NodeId
impl From<ByteString> for NodeId
Source§fn from(value: ByteString) -> Self
fn from(value: ByteString) -> Self
Converts to this type from the input type.
Source§impl From<ByteString> for String
impl From<ByteString> for String
Source§fn from(value: ByteString) -> Self
fn from(value: ByteString) -> Self
Converts to this type from the input type.
Source§impl From<Guid> for ByteString
impl From<Guid> for ByteString
Source§impl Hash for ByteString
impl Hash for ByteString
Source§impl IdentifierRef for &ByteString
impl IdentifierRef for &ByteString
Source§fn hash_as_identifier<H: Hasher>(&self, state: &mut H)
fn hash_as_identifier<H: Hasher>(&self, state: &mut H)
Hash the value as if it was in an identifier. This must result
in the same hash as the equivalent identifier.
Source§impl IdentifierRef for ByteString
impl IdentifierRef for ByteString
Source§fn hash_as_identifier<H: Hasher>(&self, state: &mut H)
fn hash_as_identifier<H: Hasher>(&self, state: &mut H)
Hash the value as if it was in an identifier. This must result
in the same hash as the equivalent identifier.
Source§impl IntoVariant for ByteString
impl IntoVariant for ByteString
Source§fn into_variant(self) -> Variant
fn into_variant(self) -> Variant
Convert self into a variant.
Source§impl JsonDecodable for ByteString
impl JsonDecodable for ByteString
Source§fn decode(
stream: &mut JsonStreamReader<&mut dyn Read>,
_ctx: &Context<'_>,
) -> EncodingResult<Self>
fn decode( stream: &mut JsonStreamReader<&mut dyn Read>, _ctx: &Context<'_>, ) -> EncodingResult<Self>
Decode Self from a JSON stream.
Source§impl JsonEncodable for ByteString
impl JsonEncodable for ByteString
Source§fn encode(
&self,
stream: &mut JsonStreamWriter<&mut dyn Write>,
_ctx: &Context<'_>,
) -> EncodingResult<()>
fn encode( &self, stream: &mut JsonStreamWriter<&mut dyn Write>, _ctx: &Context<'_>, ) -> EncodingResult<()>
Write the type to the provided JSON writer.
Source§impl PartialEq<&[u8]> for ByteString
impl PartialEq<&[u8]> for ByteString
Source§impl PartialEq<[u8]> for ByteString
impl PartialEq<[u8]> for ByteString
Source§impl PartialEq<Identifier> for &ByteString
impl PartialEq<Identifier> for &ByteString
Source§impl PartialEq<Identifier> for ByteString
impl PartialEq<Identifier> for ByteString
Source§impl PartialEq for ByteString
impl PartialEq for ByteString
Source§impl SimpleBinaryDecodable for ByteString
impl SimpleBinaryDecodable for ByteString
Source§fn decode<S: Read + ?Sized>(
stream: &mut S,
decoding_options: &DecodingOptions,
) -> EncodingResult<Self>
fn decode<S: Read + ?Sized>( stream: &mut S, decoding_options: &DecodingOptions, ) -> EncodingResult<Self>
Decode Self from the byte stream.
Source§impl SimpleBinaryEncodable for ByteString
impl SimpleBinaryEncodable for ByteString
Source§impl TryFrom<&ByteString> for Guid
impl TryFrom<&ByteString> for Guid
Source§impl TryFromVariant for ByteString
impl TryFromVariant for ByteString
Source§impl UaNullable for ByteString
impl UaNullable for ByteString
Source§fn is_ua_null(&self) -> bool
fn is_ua_null(&self) -> bool
Return true if this value is null, meaning it can be left out when
being encoded in JSON and XML encodings.
Source§impl VariantType for ByteString
impl VariantType for ByteString
Source§fn variant_type_id() -> VariantScalarTypeId
fn variant_type_id() -> VariantScalarTypeId
The variant kind this type will be represented as.
Source§impl XmlDecodable for ByteString
impl XmlDecodable for ByteString
Source§impl XmlEncodable for ByteString
impl XmlEncodable for ByteString
Source§fn encode(
&self,
writer: &mut XmlStreamWriter<&mut dyn Write>,
_context: &Context<'_>,
) -> EncodingResult<()>
fn encode( &self, writer: &mut XmlStreamWriter<&mut dyn Write>, _context: &Context<'_>, ) -> EncodingResult<()>
Encode a value to an XML stream.
Source§impl XmlType for ByteString
impl XmlType for ByteString
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> BinaryDecodable for Twhere
T: SimpleBinaryDecodable,
impl<T> BinaryDecodable for Twhere
T: SimpleBinaryDecodable,
Source§fn decode<S>(stream: &mut S, ctx: &Context<'_>) -> Result<T, Error>
fn decode<S>(stream: &mut S, ctx: &Context<'_>) -> Result<T, Error>
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.Source§impl<T> BinaryEncodable for Twhere
T: SimpleBinaryEncodable,
impl<T> BinaryEncodable for Twhere
T: SimpleBinaryEncodable,
Source§fn byte_len(&self, _ctx: &Context<'_>) -> usize
fn byte_len(&self, _ctx: &Context<'_>) -> 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, _ctx: &Context<'_>) -> Result<(), Error>
fn encode<S>(&self, stream: &mut S, _ctx: &Context<'_>) -> Result<(), Error>
Encodes the instance to the write stream.
Source§fn override_encoding(&self) -> Option<BuiltInDataEncoding>
fn override_encoding(&self) -> Option<BuiltInDataEncoding>
Override the extension object encoding used for this type.
This only makes sense if the type can only ever be encoded using a single
built-in encoding.
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.Source§impl<T> EventField for Twhere
T: IntoVariant + Clone,
impl<T> EventField for Twhere
T: IntoVariant + Clone,
Source§fn get_value(
&self,
attribute_id: AttributeId,
index_range: &NumericRange,
remaining_path: &[QualifiedName],
) -> Variant
fn get_value( &self, attribute_id: AttributeId, index_range: &NumericRange, remaining_path: &[QualifiedName], ) -> Variant
Get the variant representation of this field, using the given index range. Read more