pub struct ChainedSessionsCtl {
sender: Sender<CscCommand>,
}Expand description
Keeps track of chained sessions
Create using Self::new. Cheaply cloneable.
Fields§
§sender: Sender<CscCommand>Implementations§
Source§impl ChainedSessionsCtl
impl ChainedSessionsCtl
Sourcepub async fn create_session(&self) -> Result<Id>
pub async fn create_session(&self) -> Result<Id>
Creates a new chained session, returning its id::Id
Sourcepub async fn wait_for_result(
&self,
chained_session_id: Id,
) -> Result<YiviWaitForResultResp>
pub async fn wait_for_result( &self, chained_session_id: Id, ) -> Result<YiviWaitForResultResp>
Wait for the disclosure to arrive for the given chained session
Sourcepub async fn wait_for_next_session(
self,
chained_session_id: Id,
request_id: Id,
disclosure: JWT,
) -> Result<Option<ExtendedSessionRequest>>
pub async fn wait_for_next_session( self, chained_session_id: Id, request_id: Id, disclosure: JWT, ) -> Result<Option<ExtendedSessionRequest>>
Registers incoming disclosure and waits for the next session.
Returns None if the yivi session is to be ended normally, without starting a next
session.
Sourcepub async fn release_next_session(
&self,
chained_session_id: Id,
next_session_request: Option<ExtendedSessionRequest>,
stale_after: Option<u16>,
) -> Result<YiviReleaseNextSessionResp>
pub async fn release_next_session( &self, chained_session_id: Id, next_session_request: Option<ExtendedSessionRequest>, stale_after: Option<u16>, ) -> Result<YiviReleaseNextSessionResp>
Hands the next session request (if any) to the waiting yivi server
async fn send_command(&self, cmd: CscCommand) -> Result<()>
Sourcepub fn new(ctx: YiviCtx) -> Self
pub fn new(ctx: YiviCtx) -> Self
Creates a new ChainedSessionsCtl instance, and spawns a background task to drive it.
async fn drive(ctx: YiviCtx, receiver: Receiver<CscCommand>)
Trait Implementations§
Source§impl Clone for ChainedSessionsCtl
impl Clone for ChainedSessionsCtl
Source§fn clone(&self) -> ChainedSessionsCtl
fn clone(&self) -> ChainedSessionsCtl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChainedSessionsCtl
impl RefUnwindSafe for ChainedSessionsCtl
impl Send for ChainedSessionsCtl
impl Sync for ChainedSessionsCtl
impl Unpin for ChainedSessionsCtl
impl UnsafeUnpin for ChainedSessionsCtl
impl UnwindSafe for ChainedSessionsCtl
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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