Expand description
Channel contains a TeamSpeak 3 channel.
Example
use sqlib::channel;
let channel = sqlib::channel::Channel::new(0, "test".to_string());
assert!(channel.is_empty());
assert_eq!("test".to_string(), format!("{}", channel));
Fields
cid: i64
channel id
channel_name: String
channel name
clients: Vec<Client>
A vector of clients, who are in the channel.
Implementations
sourceimpl Channel
impl Channel
sourcepub fn new(channel_id: i64, name: String) -> Channel
pub fn new(channel_id: i64, name: String) -> Channel
Create an empty Channel from a channel id and a name.
sourcepub fn update_from_map(channel: &Channel, map: &StringMap) -> Channel
pub fn update_from_map(channel: &Channel, map: &StringMap) -> Channel
Create a new Channel from a given Channel and a map.
sourcepub fn mut_from_map(&mut self, map: &StringMap)
pub fn mut_from_map(&mut self, map: &StringMap)
Mutate self from a given map.
pub fn is_empty(&self) -> bool
pub fn clients_len(&self) -> usize
pub fn add_client(&mut self, client: Client)
pub fn sort_clients(&mut self)
sourcepub fn remove_sq_clients(&mut self)
pub fn remove_sq_clients(&mut self)
Remove all Server Query Clients from the Channel.
Trait Implementations
sourceimpl Ord for Channel
impl Ord for Channel
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Channel> for Channel
impl PartialOrd<Channel> for Channel
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Channel
Auto Trait Implementations
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnwindSafe for Channel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more