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
impl LocalBackend
Sourcepub fn new(client: ClientConfig, expect: HostExpectation) -> Self
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
impl HostBackend for LocalBackend
Source§fn discover(&self) -> Result<Option<HostGeneration>>
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>
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>
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>
fn claim_spawn(&self) -> Result<SpawnPermit>
Take the cross-process claim that serialises starting a host.
Auto Trait Implementations§
impl !RefUnwindSafe for LocalBackend
impl !UnwindSafe for LocalBackend
impl Freeze for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl UnsafeUnpin for LocalBackend
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