pub struct Operation {
pub action: OperationAction,
pub channel: ChannelRef,
pub messages: Option<Vec<MessageRef>>,
}Expand description
Operation (send or receive)
Defines an action that can be performed on a channel. Operations describe whether an application sends or receives messages through a specific channel.
§Example
use asyncapi_rust_models::{Operation, OperationAction, ChannelRef};
let operation = Operation {
action: OperationAction::Send,
channel: ChannelRef {
reference: "#/channels/chat".to_string(),
},
messages: None,
};Fields§
§action: OperationActionOperation action (send or receive)
Specifies whether the application sends or receives messages
channel: ChannelRefChannel reference
Points to the channel where this operation takes place
messages: Option<Vec<MessageRef>>Messages for this operation
Optional list of messages that can be used with this operation
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Operation
impl Serialize for Operation
Source§fn 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
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
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