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
sourceimpl 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
sourceimpl BinaryEncoder<UAString> for UAString
impl BinaryEncoder<UAString> for UAString
sourcefn 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. Read more
sourcefn 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.
sourcefn 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. Read more
fn encode_to_vec(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourceimpl<'de> Deserialize<'de> for UAString
impl<'de> Deserialize<'de> for UAString
sourcefn 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
sourceimpl From<UAString> for Identifier
impl From<UAString> for Identifier
sourcefn from(v: UAString) -> Identifier
fn from(v: UAString) -> Identifier
Converts to this type from the input type.
sourceimpl Serialize for UAString
impl Serialize for UAString
sourcefn 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 StructuralEq for UAString
impl StructuralPartialEq for UAString
Auto Trait Implementations
impl RefUnwindSafe for UAString
impl Send for UAString
impl Sync for UAString
impl Unpin for UAString
impl UnwindSafe for UAString
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more