Struct backroll::P2PSessionBuilder[][src]

pub struct P2PSessionBuilder<T> where
    T: BackrollConfig
{ /* fields omitted */ }

Implementations

impl<T> P2PSessionBuilder<T> where
    T: BackrollConfig
[src]

pub fn new() -> Self[src]

Creates a new builder. Identical to P2PSession::build.

pub fn with_disconnect_timeout(self, timeout: Duration) -> Self[src]

Sets how long the client will wait for a packet from a remote player before considering the connection disconnected. Defaults to 5000ms.

pub fn with_disconnect_notify_start(self, timeout: Duration) -> Self[src]

Sets how long the client will wait for a packet from a remote player before before firing a BackrollEvent::ConnectionInterrupted event. Defaults to 750ms.

pub fn add_player(&mut self, player: BackrollPlayer) -> BackrollPlayerHandle[src]

Adds a player to the session and returns the corresponding handle.

pub fn start(self, pool: TaskPool) -> BackrollResult<P2PSession<T>>[src]

Constructs and starts the P2PSession. Consumes the builder.

Errors

Returns BackrollError::MultipleLocalPlayers if there are multiple local players. Backroll currently only supports one local player.

Auto Trait Implementations

impl<T> RefUnwindSafe for P2PSessionBuilder<T> where
    T: RefUnwindSafe

impl<T> Send for P2PSessionBuilder<T> where
    T: Send

impl<T> Sync for P2PSessionBuilder<T> where
    T: Sync

impl<T> Unpin for P2PSessionBuilder<T> where
    T: Unpin

impl<T> UnwindSafe for P2PSessionBuilder<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V