pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
Sourcepub fn new(
role: Role,
presentation: Presentation,
code: &Code,
me: PublicKey,
identity: Option<PublicKey>,
) -> (Self, Vec<Out>)
pub fn new( role: Role, presentation: Presentation, code: &Code, me: PublicKey, identity: Option<PublicKey>, ) -> (Self, Vec<Out>)
me is this device’s throwaway author. A sender passes the identity it will hand over.
pub fn room(&self) -> PublicKey
Sourcepub fn set_face(&mut self, name: Option<String>, avatar: Option<Vec<u8>>)
pub fn set_face(&mut self, name: Option<String>, avatar: Option<Vec<u8>>)
Sender: the name and avatar thumbnail its hello carries, set before the hello goes out.
Sourcepub fn sender_face(&self) -> (Option<&str>, Option<&[u8]>)
pub fn sender_face(&self) -> (Option<&str>, Option<&[u8]>)
Receiver: the name and avatar thumbnail the sender announced. Untrusted, for display only.
Sourcepub fn last_sent(&self) -> Option<&Msg>
pub fn last_sent(&self) -> Option<&Msg>
The message to send again when the peer seems to have missed it.
Sourcepub fn is_over(&self) -> bool
pub fn is_over(&self) -> bool
Finished one way or the other: nothing more will be sent or accepted.
Sourcepub fn is_matched(&self) -> bool
pub fn is_matched(&self) -> bool
Keys agreed and nothing handed over yet: the approval window.
Sourcepub fn awaiting_reply(&self) -> bool
pub fn awaiting_reply(&self) -> bool
Waiting on the peer’s next message, so the last one should be repeated until it comes.
pub fn on_message( &mut self, author: PublicKey, msg: Result<Msg, DecodeError>, ) -> Vec<Out>
Sourcepub fn check_number(&mut self, typed: &str) -> Result<(), ApproveError>
pub fn check_number(&mut self, typed: &str) -> Result<(), ApproveError>
Sender: check the number the user typed from the new device. Three wrong tries end it.
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more