pub struct BroadcastOptions {
pub rooms: SmallVec<[Room; 4]>,
pub except: SmallVec<[Room; 4]>,
pub sid: Option<Sid>,
pub server_id: Option<Uid>,
/* private fields */
}
Expand description
Options that can be used to modify the behavior of the broadcast methods.
Fields§
§rooms: SmallVec<[Room; 4]>
The rooms to broadcast to.
except: SmallVec<[Room; 4]>
The rooms to exclude from the broadcast.
sid: Option<Sid>
The socket id of the sender.
server_id: Option<Uid>
The target server id can be used to optimize the broadcast. More specifically when we use broadcasting to apply a single action on a remote socket. We now the server_id of the remote socket, so we can send the action directly to the server.
Implementations§
Source§impl BroadcastOptions
impl BroadcastOptions
Sourcepub fn add_flag(&mut self, flag: BroadcastFlags)
pub fn add_flag(&mut self, flag: BroadcastFlags)
Add any flags to the options.
Sourcepub fn has_flag(&self, flag: BroadcastFlags) -> bool
pub fn has_flag(&self, flag: BroadcastFlags) -> bool
Check if the options have a flag.
Sourcepub fn new_remote(data: &RemoteSocketData) -> Self
pub fn new_remote(data: &RemoteSocketData) -> Self
Create a new broadcast options from a remote socket data.
Trait Implementations§
Source§impl Clone for BroadcastOptions
impl Clone for BroadcastOptions
Source§fn clone(&self) -> BroadcastOptions
fn clone(&self) -> BroadcastOptions
Returns a copy 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 BroadcastOptions
impl Debug for BroadcastOptions
Source§impl Default for BroadcastOptions
impl Default for BroadcastOptions
Source§fn default() -> BroadcastOptions
fn default() -> BroadcastOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BroadcastOptions
impl<'de> Deserialize<'de> for BroadcastOptions
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 BroadcastOptions
impl PartialEq for BroadcastOptions
Source§impl Serialize for BroadcastOptions
impl Serialize for BroadcastOptions
impl Eq for BroadcastOptions
impl StructuralPartialEq for BroadcastOptions
Auto Trait Implementations§
impl Freeze for BroadcastOptions
impl RefUnwindSafe for BroadcastOptions
impl Send for BroadcastOptions
impl Sync for BroadcastOptions
impl Unpin for BroadcastOptions
impl UnwindSafe for BroadcastOptions
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