Struct HostSessionConnector
pub struct HostSessionConnector { /* private fields */ }Expand description
A one-shot host handoff factory, evaluated on the SDK worker’s LocalSet.
The platform host supplies this to shared toolkit bootstrap. It must verify host/app/workspace handoff authority before returning its two connections. This type neither authenticates a transport nor certifies a supplied grant. The actual brokers still enforce certified joins and live signing policy. No inherited service or app-local identity is used if the factory fails.
Consumed on both success and failure. There is no automatic reconnect. A host retry must create a fresh connector and repeat admission for the same durable identity and requested route; an old handoff must not be replayed.
Implementations§
§impl HostSessionConnector
impl HostSessionConnector
pub fn new<F, Fut, C, I>(connect: F) -> HostSessionConnector
pub fn new<F, Fut, C, I>(connect: F) -> HostSessionConnector
Supply a factory for an owned collaboration stream and broker signer.
The factory runs only inside the SDK worker’s Tokio runtime/LocalSet and returns separate owned collaboration and identity transports. Only the factory and its captures cross threads; its future and streams may be !Send. It must authenticate both endpoints and enforce the requested route. Shared code frames and bounds every identity exchange async. The manager waits for the factory’s own outcome: a factory that cannot connect returns why.
Merely returning metadata does not establish authentication. Do not use this constructor as a replacement for host transport/grant validation.
pub fn with_descriptor_lane<F, Fut, C, I>(connect: F) -> HostSessionConnector
pub fn with_descriptor_lane<F, Fut, C, I>(connect: F) -> HostSessionConnector
Self::new for a collaboration stream that is a local socket: its
writes also carry the descriptors the app hands the broker, as the
launcher’s inherited service connection does, so an in-process app
can hand Files’ selected objects over exactly as a launched one. A
host whose streams carry no descriptors gives an empty lane.
§impl HostSessionConnector
impl HostSessionConnector
pub fn once_ready<F, Fut>(self, ready: F) -> HostSessionConnector
pub fn once_ready<F, Fut>(self, ready: F) -> HostSessionConnector
Connect only once ready resolves: when the host says the services
this connection reaches are listening, or that their start is over.
A host showing an app while it is still starting those services
(a session restoring its tabs before it binds its broker) waits for
them; connecting before then finds no socket and leaves the app
offline.
ready must resolve once the host’s start is over, whatever its
outcome.
Auto Trait Implementations§
impl Freeze for HostSessionConnector
impl !RefUnwindSafe for HostSessionConnector
impl Send for HostSessionConnector
impl !Sync for HostSessionConnector
impl Unpin for HostSessionConnector
impl UnsafeUnpin for HostSessionConnector
impl !UnwindSafe for HostSessionConnector
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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