pub enum ServerFrame {
Connected {
id: String,
conn_id: String,
user_id: String,
ts: i64,
},
Joined {
id: String,
channel: String,
ts: i64,
},
Left {
id: String,
channel: String,
ts: i64,
},
Event {
id: String,
channel: String,
event: String,
data: Value,
from_user: Option<String>,
ts: i64,
},
Ack {
id: String,
for_id: String,
ok: bool,
error: Option<ErrorPayload>,
ts: i64,
},
Pong {
id: String,
ts: i64,
},
Error {
id: String,
error: ErrorPayload,
ts: i64,
},
}Variants§
Implementations§
Source§impl ServerFrame
impl ServerFrame
pub fn connected(conn_id: impl Into<String>, user_id: impl Into<String>) -> Self
pub fn event( channel: impl Into<String>, event: impl Into<String>, data: Value, from_user: Option<String>, ) -> Self
pub fn ack_ok(for_id: impl Into<String>) -> Self
pub fn ack_err(for_id: impl Into<String>, code: &str, message: &str) -> Self
pub fn pong(for_id: impl Into<String>) -> Self
pub fn error(code: &str, message: &str) -> Self
Trait Implementations§
Source§impl Clone for ServerFrame
impl Clone for ServerFrame
Source§fn clone(&self) -> ServerFrame
fn clone(&self) -> ServerFrame
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 ServerFrame
impl Debug for ServerFrame
Source§impl<'de> Deserialize<'de> for ServerFrame
impl<'de> Deserialize<'de> for ServerFrame
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
Auto Trait Implementations§
impl Freeze for ServerFrame
impl RefUnwindSafe for ServerFrame
impl Send for ServerFrame
impl Sync for ServerFrame
impl Unpin for ServerFrame
impl UnsafeUnpin for ServerFrame
impl UnwindSafe for ServerFrame
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