UserState

Struct UserState 

Source
pub struct UserState {
Show 23 fields pub session: Option<u32>, pub actor: Option<u32>, pub name: Option<String>, pub user_id: Option<u32>, pub channel_id: Option<u32>, pub mute: Option<bool>, pub deaf: Option<bool>, pub suppress: Option<bool>, pub self_mute: Option<bool>, pub self_deaf: Option<bool>, pub texture: Option<Vec<u8>>, pub plugin_context: Option<Vec<u8>>, pub plugin_identity: Option<String>, pub comment: Option<String>, pub hash: Option<String>, pub comment_hash: Option<Vec<u8>>, pub texture_hash: Option<Vec<u8>>, pub priority_speaker: Option<bool>, pub recording: Option<bool>, pub temporary_access_tokens: Vec<String>, pub listening_channel_add: Vec<u32>, pub listening_channel_remove: Vec<u32>, pub listening_volume_adjustment: Vec<VolumeAdjustment>,
}
Expand description

Sent by the server when it communicates new and changed users to client. First seen during login procedure. May be sent by the client when it wishes to alter its state.

Fields§

§session: Option<u32>

Unique user session ID of the user whose state this is, may change on reconnect.

§actor: Option<u32>

The session of the user who is updating this user.

§name: Option<String>

User name, UTF-8 encoded.

§user_id: Option<u32>

Registered user ID if the user is registered.

§channel_id: Option<u32>

Channel on which the user is.

§mute: Option<bool>

True if the user is muted by admin.

§deaf: Option<bool>

True if the user is deafened by admin.

§suppress: Option<bool>

True if the user has been suppressed from talking by a reason other than being muted.

§self_mute: Option<bool>

True if the user has muted self.

§self_deaf: Option<bool>

True if the user has deafened self.

§texture: Option<Vec<u8>>

User image if it is less than 128 bytes.

§plugin_context: Option<Vec<u8>>

The positional audio plugin identifier. Positional audio information is only sent to users who share identical plugin contexts.

This value is not transmitted to clients.

§plugin_identity: Option<String>

The user’s plugin-specific identity. This value is not transmitted to clients.

§comment: Option<String>

User comment if it is less than 128 bytes.

§hash: Option<String>

The hash of the user certificate.

§comment_hash: Option<Vec<u8>>

SHA1 hash of the user comment if it 128 bytes or more.

§texture_hash: Option<Vec<u8>>

SHA1 hash of the user picture if it 128 bytes or more.

§priority_speaker: Option<bool>

True if the user is a priority speaker.

§recording: Option<bool>

True if the user is currently recording.

§temporary_access_tokens: Vec<String>

A list of temporary access tokens to be respected when processing this request.

§listening_channel_add: Vec<u32>

A list of channels the user wants to start listening to.

§listening_channel_remove: Vec<u32>

a list of channels the user does no longer want to listen to.

§listening_volume_adjustment: Vec<VolumeAdjustment>

A list of volume adjustments the user has applied to listeners

Implementations§

Source§

impl UserState

Source

pub fn session(&self) -> u32

Returns the value of session, or the default value if session is unset.

Source

pub fn actor(&self) -> u32

Returns the value of actor, or the default value if actor is unset.

Source

pub fn name(&self) -> &str

Returns the value of name, or the default value if name is unset.

Source

pub fn user_id(&self) -> u32

Returns the value of user_id, or the default value if user_id is unset.

Source

pub fn channel_id(&self) -> u32

Returns the value of channel_id, or the default value if channel_id is unset.

Source

pub fn mute(&self) -> bool

Returns the value of mute, or the default value if mute is unset.

Source

pub fn deaf(&self) -> bool

Returns the value of deaf, or the default value if deaf is unset.

Source

pub fn suppress(&self) -> bool

Returns the value of suppress, or the default value if suppress is unset.

Source

pub fn self_mute(&self) -> bool

Returns the value of self_mute, or the default value if self_mute is unset.

Source

pub fn self_deaf(&self) -> bool

Returns the value of self_deaf, or the default value if self_deaf is unset.

Source

pub fn texture(&self) -> &[u8]

Returns the value of texture, or the default value if texture is unset.

Source

pub fn plugin_context(&self) -> &[u8]

Returns the value of plugin_context, or the default value if plugin_context is unset.

Source

pub fn plugin_identity(&self) -> &str

Returns the value of plugin_identity, or the default value if plugin_identity is unset.

Source

pub fn comment(&self) -> &str

Returns the value of comment, or the default value if comment is unset.

Source

pub fn hash(&self) -> &str

Returns the value of hash, or the default value if hash is unset.

Source

pub fn comment_hash(&self) -> &[u8]

Returns the value of comment_hash, or the default value if comment_hash is unset.

Source

pub fn texture_hash(&self) -> &[u8]

Returns the value of texture_hash, or the default value if texture_hash is unset.

Source

pub fn priority_speaker(&self) -> bool

Returns the value of priority_speaker, or the default value if priority_speaker is unset.

Source

pub fn recording(&self) -> bool

Returns the value of recording, or the default value if recording is unset.

Trait Implementations§

Source§

impl Clone for UserState

Source§

fn clone(&self) -> UserState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UserState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UserState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for UserState

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for UserState

Source§

fn eq(&self, other: &UserState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UserState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.