pub struct Session { /* private fields */ }Expand description
One client’s verified connection to the host, bound to the generation it was acquired
against. Dropping it releases it like DaemonLifecycle::release_session.
Implementations§
Source§impl Session
impl Session
pub fn provenance(&self) -> Provenance
pub fn host(&self) -> &HostGeneration
pub fn label(&self) -> &str
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether the connection is usable: not released, not closed, and still the current epoch.
A true is not a promise about the next call, which revalidates again.
Sourcepub fn call(&self, method: &str, params: Value) -> Result<Value, LifecycleError>
pub fn call(&self, method: &str, params: Value) -> Result<Value, LifecycleError>
One request. The host generation is confirmed before the request is written and again
before the reply is handed back; a reply from a host that is no longer the current one is
LifecycleError::StaleGeneration, never a success. Handler errors arrive as
LifecycleError::Service.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin 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