Struct opcua_server::prelude::Chunker
source · [−]pub struct Chunker;
Expand description
The Chunker is responsible for turning messages to chunks and chunks into messages.
Implementations
sourceimpl Chunker
impl Chunker
sourcepub fn validate_chunks(
starting_sequence_number: u32,
secure_channel: &SecureChannel,
chunks: &[MessageChunk]
) -> Result<u32, StatusCode>
pub fn validate_chunks(
starting_sequence_number: u32,
secure_channel: &SecureChannel,
chunks: &[MessageChunk]
) -> Result<u32, StatusCode>
Ensure all of the supplied chunks have a valid secure channel id, and sequence numbers greater than the input sequence number and the preceding chunk
The function returns the last sequence number in the series for success, or
BadSequenceNumberInvalid
or BadSecureChannelIdInvalid
for failure.
sourcepub fn encode(
sequence_number: u32,
request_id: u32,
max_message_size: usize,
max_chunk_size: usize,
secure_channel: &SecureChannel,
supported_message: &SupportedMessage
) -> Result<Vec<MessageChunk, Global>, StatusCode>
pub fn encode(
sequence_number: u32,
request_id: u32,
max_message_size: usize,
max_chunk_size: usize,
secure_channel: &SecureChannel,
supported_message: &SupportedMessage
) -> Result<Vec<MessageChunk, Global>, StatusCode>
Encodes a message using the supplied sequence number and secure channel info and emits the corresponding chunks
max_chunk_count refers to the maximum byte length that a chunk should not exceed or 0 for no limit max_message_size refers to the maximum byte length of a message or 0 for no limit
sourcepub fn decode(
chunks: &[MessageChunk],
secure_channel: &SecureChannel,
expected_node_id: Option<NodeId>
) -> Result<SupportedMessage, StatusCode>
pub fn decode(
chunks: &[MessageChunk],
secure_channel: &SecureChannel,
expected_node_id: Option<NodeId>
) -> Result<SupportedMessage, StatusCode>
Decodes a series of chunks to create a message. The message must be of a SupportedMessage
type otherwise an error will occur.
Auto Trait Implementations
impl RefUnwindSafe for Chunker
impl Send for Chunker
impl Sync for Chunker
impl Unpin for Chunker
impl UnwindSafe for Chunker
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