Skip to main content

SessionConfig

Struct SessionConfig 

Source
pub struct SessionConfig {
    pub host: ExpectedHost,
    pub community_id: Option<CommunityId>,
    pub binding: Option<Binding>,
    pub accepted: Option<AcceptedState>,
    pub rotations: Vec<SignedRootRotation>,
    pub held_pair: Option<(SignedJson, SignedJson)>,
    pub versions: VersionRange,
    pub capabilities: Vec<String>,
    pub text_budget: usize,
    pub retry: RetryPolicy,
    pub ack_every_frames: u32,
    pub ack_every_ms: u64,
}
Expand description

Everything a super::Session needs besides the transport.

Fields§

§host: ExpectedHost

The host the welcome must come from.

§community_id: Option<CommunityId>

The community the host must prove (invitation target, or the bound community). None only for an unbound connection with no target (before community.create).

§binding: Option<Binding>

The connection’s binding from an earlier session, if any (restart persistence).

§accepted: Option<AcceptedState>

The caller’s stored anti-rollback state for the community (§4.3 rule 5).

§rotations: Vec<SignedRootRotation>

The full rotation chain from the genesis key, if the caller has it (§4.6).

§held_pair: Option<(SignedJson, SignedJson)>

The signed descriptor and delegation of the community, as verified before (a stored crate::signed::ValidPair): the hello names it and the host may leave it out of the welcome; it is then verified again as if the host had sent it (§6.2).

§versions: VersionRange

The versions offered in session.hello.

§capabilities: Vec<String>

The capabilities offered in session.hello.

§text_budget: usize

Per-message text budget for framing (§5.1), from the transport adapter.

§retry: RetryPolicy

Retry schedule (§7.3).

§ack_every_frames: u32

Ack after this many received frames (§10.5: at most 8).

§ack_every_ms: u64

Ack after this long while frames arrive (§10.5: at most 30 s).

Implementations§

Source§

impl SessionConfig

Source

pub fn new(host: ExpectedHost, community_id: Option<CommunityId>) -> Self

Defaults for host and community_id: version 1, frag, the §7.3 schedule and the §10.5 ack cadence (8 frames / 30 s).

Trait Implementations§

Source§

impl Clone for SessionConfig

Source§

fn clone(&self) -> SessionConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionConfig

Source§

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

Formats the value using the given formatter. 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> 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> Same for T

Source§

type Output = T

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