Skip to main content

LocalBackend

Struct LocalBackend 

Source
pub struct LocalBackend { /* private fields */ }
Expand description

The local service.json transport: discovery through the suite, identity through Client::connect_expecting.

Implementations§

Source§

impl LocalBackend

Source

pub fn new(client: ClientConfig, expect: HostExpectation) -> Self

client names the service, the app label and the suite (see ClientConfig); expect names the executable the host may be. An expectation is required: attaching to a host whose program was never checked is not offered.

Trait Implementations§

Source§

impl HostBackend for LocalBackend

Source§

fn discover(&self) -> Result<Option<HostGeneration>>

The live published host now, or None. An unreadable record is Err (unknown), never None: the lifecycle must not start a second host on an unknown.
Source§

fn connect( &self, host: &HostGeneration, ) -> Result<Box<dyn HostLink>, LifecycleError>

Open a connection to exactly host, after verifying who is on the other end. A host that fails the identity check is LifecycleError::HostIdentity; nothing application-level was sent to it.
Source§

fn is_current(&self, host: &HostGeneration) -> Result<bool>

Whether host is still the published, live generation. Called before every request and before every reply is handed back, so it should be cheap (no connection).
Source§

fn claim_spawn(&self) -> Result<SpawnPermit>

Take the cross-process claim that serialises starting a host.

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.