pub struct UnifiedRequest {
pub CorrelationIdentifier: Option<CorrelationId>,
pub Method: String,
pub Payload: Vec<u8>,
pub Metadata: HashMap<String, String>,
pub CreatedAt: Timestamp,
pub TransportHint: Option<TransportType>,
}Expand description
A unified request message that can be sent over any transport.
Fields§
§CorrelationIdentifier: Option<CorrelationId>Unique correlation ID for request/response matching.
Method: StringThe method to invoke, using dot notation (e.g., “fileSystem.readFile”).
Payload: Vec<u8>Binary payload containing serialized parameters for the method.
Metadata: HashMap<String, String>Optional metadata for the request.
CreatedAt: TimestampTimestamp when the request was created (microseconds since Unix epoch).
TransportHint: Option<TransportType>Optional hint for preferred transport type.
Implementations§
Source§impl UnifiedRequest
impl UnifiedRequest
Sourcepub fn New(Method: impl Into<String>) -> Self
pub fn New(Method: impl Into<String>) -> Self
Creates a new UnifiedRequest with the given method.
Sourcepub fn WithCorrelationIdentifier(
self,
CorrelationIdentifier: CorrelationId,
) -> Self
pub fn WithCorrelationIdentifier( self, CorrelationIdentifier: CorrelationId, ) -> Self
Sets the correlation ID explicitly.
Sourcepub fn WithPayload(self, Payload: Vec<u8>) -> Self
pub fn WithPayload(self, Payload: Vec<u8>) -> Self
Sets the binary payload.
Sourcepub fn WithMetadata(
self,
Key: impl Into<String>,
Value: impl Into<String>,
) -> Self
pub fn WithMetadata( self, Key: impl Into<String>, Value: impl Into<String>, ) -> Self
Adds a metadata key-value pair.
Sourcepub fn WithMetadataMap(self, Metadata: HashMap<String, String>) -> Self
pub fn WithMetadataMap(self, Metadata: HashMap<String, String>) -> Self
Sets the entire metadata map.
Sourcepub fn WithTimeout(self, TimeoutMilliseconds: u64) -> Self
pub fn WithTimeout(self, TimeoutMilliseconds: u64) -> Self
Sets the request timeout in milliseconds.
Sourcepub fn WithPriority(self, Priority: u32) -> Self
pub fn WithPriority(self, Priority: u32) -> Self
Sets the request priority.
Sourcepub fn WithTransportHint(self, TransportKind: TransportType) -> Self
pub fn WithTransportHint(self, TransportKind: TransportType) -> Self
Sets the preferred transport type.
Sourcepub fn TimeoutMilliseconds(&self) -> Option<u64>
pub fn TimeoutMilliseconds(&self) -> Option<u64>
Gets the timeout from metadata, if present.
Trait Implementations§
Source§impl Clone for UnifiedRequest
impl Clone for UnifiedRequest
Source§fn clone(&self) -> UnifiedRequest
fn clone(&self) -> UnifiedRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnifiedRequest
impl Debug for UnifiedRequest
Source§impl<'de> Deserialize<'de> for UnifiedRequest
impl<'de> Deserialize<'de> for UnifiedRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UnifiedRequest
impl PartialEq for UnifiedRequest
Source§impl Serialize for UnifiedRequest
impl Serialize for UnifiedRequest
impl Eq for UnifiedRequest
impl StructuralPartialEq for UnifiedRequest
Auto Trait Implementations§
impl Freeze for UnifiedRequest
impl RefUnwindSafe for UnifiedRequest
impl Send for UnifiedRequest
impl Sync for UnifiedRequest
impl Unpin for UnifiedRequest
impl UnsafeUnpin for UnifiedRequest
impl UnwindSafe for UnifiedRequest
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,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.