pub enum Message {
Show 23 variants
AccessRights(AccessRights),
ClearChannel(ClearChannel),
ClientName(ClientName),
CreateChannel(CreateChannel),
CreateChannelFailure(CreateChannelFailure),
CreateChannelResponse(CreateChannelResponse),
ECAError(ECAError),
Echo,
EventAdd(EventAdd),
EventCancel(EventCancel),
EventAddResponse(EventAddResponse),
EventsOff,
EventsOn,
HostName(HostName),
ReadNotify(ReadNotify),
ReadNotifyResponse(ReadNotifyResponse),
RsrvIsUp(RsrvIsUp),
Search(Search),
SearchResponse(SearchResponse),
ServerDisconnect(ServerDisconnect),
Write(Write),
WriteNotify(WriteNotify),
Version(Version),
}Expand description
Represent any message.
Provides utility function Message::read_server_message to translate a
raw stream into parsed messages.
Variants§
AccessRights(AccessRights)
ClearChannel(ClearChannel)
ClientName(ClientName)
CreateChannel(CreateChannel)
CreateChannelFailure(CreateChannelFailure)
CreateChannelResponse(CreateChannelResponse)
ECAError(ECAError)
Echo
EventAdd(EventAdd)
EventCancel(EventCancel)
EventAddResponse(EventAddResponse)
EventsOff
EventsOn
HostName(HostName)
ReadNotify(ReadNotify)
ReadNotifyResponse(ReadNotifyResponse)
RsrvIsUp(RsrvIsUp)
Search(Search)
SearchResponse(SearchResponse)
ServerDisconnect(ServerDisconnect)
Write(Write)
WriteNotify(WriteNotify)
Version(Version)
Implementations§
Source§impl Message
impl Message
Sourcepub async fn read_server_message<T: AsyncRead + Unpin>(
source: &mut T,
) -> Result<Self, MessageError>
pub async fn read_server_message<T: AsyncRead + Unpin>( source: &mut T, ) -> Result<Self, MessageError>
Parse message sent to the server, directly from a stream.
Handles any message that could be sent to the server, not messages that could be sent to a client. This is because some response messages have the same command ID but different fields, so it is impossible to tell which is which purely from the contents of the message.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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