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
pub fn value(&self) -> &Option<String>
pub fn set_value(&mut self, value: Option<String>)
Sourcepub fn substring(&self, min: usize, max: usize) -> Result<UAString, ()>
pub fn substring(&self, min: usize, max: usize) -> Result<UAString, ()>
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 BinaryEncoder<UAString> for UAString
impl BinaryEncoder<UAString> for UAString
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<UAString, StatusCode>where
S: Read,
fn decode<S>(
stream: &mut S,
decoding_options: &DecodingOptions,
) -> Result<UAString, 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<'de> Deserialize<'de> for UAString
impl<'de> Deserialize<'de> for UAString
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UAString, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UAString, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<UAString> for Identifier
impl From<UAString> for Identifier
Source§fn from(v: UAString) -> Identifier
fn from(v: UAString) -> Identifier
Converts to this type from the input type.
Source§impl Serialize for UAString
impl Serialize for UAString
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
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> 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.