Struct SurfacePeer
pub struct SurfacePeer { /* private fields */ }Expand description
The app’s end of the connection to its session.
Cloneable pieces are not: the reader thread owns the receiving half.
Implementations§
§impl SurfacePeer
impl SurfacePeer
pub fn from_descriptor(number: i32) -> Option<SurfacePeer>
pub fn from_descriptor(number: i32) -> Option<SurfacePeer>
The peer on the already connected socket handed over as
ACTIONS_FD_ENV’s number;
None when the number names no socket.
pub fn of(stream: UnixStream) -> SurfacePeer
pub fn of(stream: UnixStream) -> SurfacePeer
A peer on stream, one end of a socket to the session.
Trait Implementations§
§impl PeerTransport for SurfacePeer
impl PeerTransport for SurfacePeer
fn is_connected(&self) -> bool
§fn hosts_surface(&self) -> bool
fn hosts_surface(&self) -> bool
Whether this app is a surface of the desktop it speaks to, rather than
an app of a document: what it offers lives with that desktop, so no
document history custodies its actions.
fn send(&mut self, request: CollabRequest) -> Result<(), String>
§fn take_primary_route_result(&mut self) -> Option<Result<RouteSpec, String>>
fn take_primary_route_result(&mut self) -> Option<Result<RouteSpec, String>>
The real broker acknowledgement of the latest Hello, never an optimistic echo.
§fn set_wake(&mut self, wake: Box<dyn Fn() + Send + Sync>)
fn set_wake(&mut self, wake: Box<dyn Fn() + Send + Sync>)
Install the callback that schedules this owner’s next frame, as
super::CollabTransport::set_wake does for a host-supplied
transport: a peer answered on a thread of its own calls it, so what
it carries is not left waiting for an unrelated frame.fn poll(&mut self) -> Vec<CollabEvent<SdkCustody>>
§fn connection_snapshot(&self, _: &RouteSpec) -> Option<ConnectionSnapshot>
fn connection_snapshot(&self, _: &RouteSpec) -> Option<ConnectionSnapshot>
Authenticated connection provenance from the host, never app model state.
§fn action_of(
&self,
_workspace: &str,
_change: &[u8; 32],
) -> Option<CommitHistory>
fn action_of( &self, _workspace: &str, _change: &[u8; 32], ) -> Option<CommitHistory>
The whole action the change
change was part of, when the peer keeps
the index of the actions it carries in workspace: every unit the
action wrote, which is what one undo takes back.§fn join_route(&mut self, _: RouteSpec, _: RecordKind) -> Result<(), String>
fn join_route(&mut self, _: RouteSpec, _: RecordKind) -> Result<(), String>
Join
route, whose record holds record_kind. The kind is what a
host needs to create the record on this device’s first change.fn send_to_route( &mut self, _: RouteSpec, _: CollabRequest, ) -> Result<(), String>
fn publish_action_directory(&mut self, _: String) -> Result<(), String>
fn take_action_directory_requests(&mut self) -> Vec<ActionDirectoryRequest>
fn install_document_encryption( &mut self, _: RouteSpec, _: ChannelGroup, ) -> Result<(), String>
Auto Trait Implementations§
impl Freeze for SurfacePeer
impl RefUnwindSafe for SurfacePeer
impl Send for SurfacePeer
impl !Sync for SurfacePeer
impl Unpin for SurfacePeer
impl UnsafeUnpin for SurfacePeer
impl UnwindSafe for SurfacePeer
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
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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>
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