PrivateBuilder

Struct PrivateBuilder 

Source
pub struct PrivateBuilder<'a> { /* private fields */ }
Expand description

The constructor for one connection’s private elements.

Implementations§

Source§

impl PrivateBuilder<'_>

Source

pub fn user_in( &mut self, channel: ChannelRef, who: Occupant, name: &str, ) -> UserRef

Place a user in a channel, visible to this connection only.

The channel is one this connection can already see - which ShardBuilder::finish verifies rather than assumes.

Source

pub fn channel( &mut self, parent: ChannelRef, key: ChannelKey, name: &str, ) -> ChannelRef

A channel visible to this connection only.

Source

pub fn user_flags(&mut self, user: UserRef, flags: UserFlags)

Source

pub fn action(&mut self, key: ActionKey, text: &str, on: On)

Offer this connection a context action: a button that is not a channel to double-click.

Declared like everything else, and withdrawn by simply not declaring it again. The flavor never emits a message; the difference with what this connection was already offered is what travels.

Offering the same key twice in one render is the last call winning, which is the same rule a flavor already gets from rendering a user twice.

Auto Trait Implementations§

§

impl<'a> Freeze for PrivateBuilder<'a>

§

impl<'a> RefUnwindSafe for PrivateBuilder<'a>

§

impl<'a> Send for PrivateBuilder<'a>

§

impl<'a> Sync for PrivateBuilder<'a>

§

impl<'a> Unpin for PrivateBuilder<'a>

§

impl<'a> !UnwindSafe for PrivateBuilder<'a>

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> 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, 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.