pub struct String(/* private fields */);Expand description
Wrapper for
UA_String
from open62541_sys.
This owns the wrapped data. When the wrapper is dropped, the inner value is cleaned up
with UA_clear() to release dynamically allocated memory held by the value.
Implementations§
Source§impl String
impl String
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Checks if string is null and invalid.
The null state is defined by OPC UA. It is a third state which is distinct from empty and regular (non-empty) strings.
Sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Returns string contents as byte slice.
This may return None when the string itself is invalid (as defined by OPC UA).
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns string contents as string slice.
This may return None when the string itself is invalid (as defined by OPC UA) or when it
is not valid Unicode (UTF-8).
Sourcepub fn into_byte_string(self) -> ByteString
pub fn into_byte_string(self) -> ByteString
Converts string into byte string.
This is lossless because the underlying types of OPC UA strings and byte strings are exactly the same, only with different semantics.
Trait Implementations§
Source§impl DataType for String
impl DataType for String
Source§unsafe fn from_raw(src: Self::Inner) -> Self
unsafe fn from_raw(src: Self::Inner) -> Self
Source§fn take_raw(src: &mut Self::Inner) -> Self
fn take_raw(src: &mut Self::Inner) -> Self
src. Read moreSource§fn clone_into_raw(&self, dst: &mut Self::Inner)
fn clone_into_raw(&self, dst: &mut Self::Inner)
dst. Read moreSource§fn move_into_raw(self, dst: &mut Self::Inner)
fn move_into_raw(self, dst: &mut Self::Inner)
dst, giving up ownership. Read more