Implement MessageCapable trait methods in gateway

default module
This commit is contained in:
bitfl0wer 2023-11-18 20:02:28 +01:00
parent 29efae385e
commit 287b72c99c
1 changed files with 9 additions and 6 deletions

View File

@ -35,15 +35,18 @@ impl crate::gateway::MessageCapable for tokio_tungstenite::tungstenite::Message
}
fn is_empty(&self) -> bool {
todo!()
match self {
Message::Text(text) => text.is_empty(),
Message::Binary(bytes) => bytes.is_empty(),
_ => false,
}
fn is_error(&self) -> bool {
todo!()
}
fn as_bytes(&self) -> Option<Vec<u8>> {
todo!()
match self {
Message::Binary(bytes) => Some(bytes.clone()),
_ => None,
}
}
}