pub struct UAString { /* private fields */ }
Expand description
To avoid naming conflict hell, the OPC UA String type is typed UAString
so it does not collide
with the Rust String
.
A string contains UTF-8 encoded characters or a null value. A null value is distinct from
being an empty string so internally, the code maintains that distinction by holding the value
as an Option<String>
.
Implementations§
Source§impl UAString
impl UAString
Sourcepub fn substring(&self, min: usize, max: usize) -> Result<UAString, OutOfRange>
pub fn substring(&self, min: usize, max: usize) -> Result<UAString, 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 From<UAString> for Identifier
impl From<UAString> for Identifier
Source§impl From<UAString> for XmlElement
impl From<UAString> for XmlElement
Source§impl IntoVariant for UAString
impl IntoVariant for UAString
Source§fn into_variant(self) -> Variant
fn into_variant(self) -> Variant
Convert self into a variant.
Source§impl JsonDecodable for UAString
impl JsonDecodable for UAString
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 UAString
impl JsonEncodable for UAString
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 SimpleBinaryDecodable for UAString
impl SimpleBinaryDecodable for UAString
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 UAString
impl SimpleBinaryEncodable for UAString
Source§impl TryFromVariant for UAString
impl TryFromVariant for UAString
Source§impl UaNullable for UAString
impl UaNullable for UAString
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 UAString
impl VariantType for UAString
Source§fn variant_type_id() -> VariantScalarTypeId
fn variant_type_id() -> VariantScalarTypeId
The variant kind this type will be represented as.
Source§impl XmlDecodable for UAString
impl XmlDecodable for UAString
Source§impl XmlEncodable for UAString
impl XmlEncodable for UAString
impl Eq for UAString
impl StructuralPartialEq for UAString
Auto Trait Implementations§
impl Freeze for UAString
impl RefUnwindSafe for UAString
impl Send for UAString
impl Sync for UAString
impl Unpin for UAString
impl UnwindSafe for UAString
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§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