Struct opcua_server::prelude::ExtensionObject [−][src]
pub struct ExtensionObject {
pub node_id: NodeId,
pub body: ExtensionObjectEncoding,
}Expand description
An extension object holds a serialized object identified by its node id.
Fields
node_id: NodeIdbody: ExtensionObjectEncodingImplementations
Creates a null extension object, i.e. one with no value or payload
Returns the object id of the thing this extension object contains, assuming the object id can be recognised from the node id.
pub fn from_encodable<N, T>(node_id: N, encodable: &T) -> ExtensionObject where
T: BinaryEncoder<T>,
N: Into<NodeId>,
pub fn from_encodable<N, T>(node_id: N, encodable: &T) -> ExtensionObject where
T: BinaryEncoder<T>,
N: Into<NodeId>,
Creates an extension object with the specified node id and the encodable object as its payload. The body is set to a byte string containing the encoded struct.
pub fn decode_inner<T>(
&self,
decoding_limits: &DecodingLimits
) -> Result<T, StatusCode> where
T: BinaryEncoder<T>,
pub fn decode_inner<T>(
&self,
decoding_limits: &DecodingLimits
) -> Result<T, StatusCode> where
T: BinaryEncoder<T>,
Decodes the inner content of the extension object and returns it. The node id is ignored for decoding. The caller supplies the binary encoder impl that should be used to extract the data. Errors result in a decoding error.
Trait Implementations
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
Encodes the instance to the write stream.
pub fn decode<S>(
stream: &mut S,
decoding_limits: &DecodingLimits
) -> Result<ExtensionObject, StatusCode> where
S: Read,
pub fn decode<S>(
stream: &mut S,
decoding_limits: &DecodingLimits
) -> Result<ExtensionObject, StatusCode> where
S: Read,
Decodes an instance from the read stream. The decoding limits are 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
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<ExtensionObject, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<ExtensionObject, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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
type Error = StatusCode
type Error = StatusCode
The type returned in the event of a conversion error.
pub fn try_from(
v: &ExtensionObject
) -> Result<Operand, <Operand as TryFrom<&'_ ExtensionObject>>::Error>
pub fn try_from(
v: &ExtensionObject
) -> Result<Operand, <Operand as TryFrom<&'_ ExtensionObject>>::Error>
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for ExtensionObject
impl Send for ExtensionObject
impl Sync for ExtensionObject
impl Unpin for ExtensionObject
impl UnwindSafe for ExtensionObject
Blanket Implementations
Mutably borrows from an owned value. Read more