Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source

pub fn new(mtu: usize) -> Self

Source

pub fn with_tunables(mtu: usize, tunables: SessionTunables) -> Self

Source

pub fn state(&self) -> SessionState

Source

pub fn transition_to(&mut self, next: SessionState) -> bool

Source

pub fn mtu(&self) -> usize

Source

pub fn set_mtu(&mut self, mtu: usize)

Source

pub fn touch_activity(&mut self, now: Instant)

Source

pub fn idle_for(&self, now: Instant) -> Duration

Source

pub fn should_send_keepalive(&self, now: Instant, interval: Duration) -> bool

Source

pub fn mark_keepalive_sent(&mut self, now: Instant)

Source

pub fn next_datagram_sequence(&mut self) -> Sequence24

Source

pub fn pending_outgoing_frames(&self) -> usize

Source

pub fn pending_outgoing_bytes(&self) -> usize

Source

pub fn force_control_flush_deadlines(&mut self, now: Instant)

Source

pub fn take_backpressure_disconnect(&mut self) -> bool

Source

pub fn metrics_snapshot(&self) -> SessionMetricsSnapshot

Source

pub fn process_datagram_sequence(&mut self, seq: Sequence24, now: Instant)

Source

pub fn ingest_datagram( &mut self, datagram: Datagram, now: Instant, ) -> Result<Vec<Frame>, DecodeError>

Source

pub fn handle_ack_payload(&mut self, payload: AckNackPayload)

Source

pub fn handle_nack_payload(&mut self, payload: AckNackPayload)

Source

pub fn drain_ack_datagram(&mut self, now: Instant) -> Option<Datagram>

Source

pub fn drain_nack_datagram(&mut self, now: Instant) -> Option<Datagram>

Source

pub fn track_sent_reliable_datagram( &mut self, datagram: Datagram, now: Instant, receipt_ids: Vec<u64>, )

Source

pub fn queue_payload( &mut self, payload: Bytes, reliability: Reliability, channel: u8, priority: RakPriority, ) -> QueuePayloadResult

Source

pub fn queue_payload_with_receipt( &mut self, payload: Bytes, reliability: Reliability, channel: u8, priority: RakPriority, receipt_id: Option<u64>, ) -> QueuePayloadResult

Source

pub fn process_incoming_receipts(&mut self, now: Instant) -> ReceiptProgress

Source

pub fn collect_resendable( &mut self, now: Instant, max_count: usize, max_bytes: usize, ) -> Vec<Datagram>

Source

pub fn build_data_datagram( &mut self, now: Instant, remaining_bytes_budget: &mut usize, ) -> Option<Datagram>

Source

pub fn on_tick( &mut self, now: Instant, max_new_datagrams: usize, max_new_bytes: usize, max_resend_datagrams: usize, max_resend_bytes: usize, ) -> Vec<Datagram>

Source

pub fn prune_split_state(&mut self, now: Instant) -> usize

Trait Implementations§

Source§

impl Drop for Session

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more