pub struct TransportState {
pub surface: Arc<ViewSurface>,
pub work: Arc<WorkCache>,
pub conversations: Arc<Conversations>,
pub live: Mutex<Live>,
pub settings: Sender<Option<Arc<str>>>,
pub browser_host: Option<Arc<dyn BrowserHost>>,
pub heartbeat: Heartbeat,
}Expand description
What a connection answers from: the surface it reads and dispatches
through, the working-tree cache behind the git read, the conversations
the stream has seeded, the live state a late subscriber cannot
reconstruct for itself, and the [client] settings the greeting carries.
The conversations are here rather than on the surface because they are the TRANSPORT’s: they exist so this socket stops reading a whole transcript per client per request, and a view reading the same seat through the surface keeps its own copy in its own session state.
Fields§
§surface: Arc<ViewSurface>§work: Arc<WorkCache>§conversations: Arc<Conversations>§live: Mutex<Live>§settings: Sender<Option<Arc<str>>>The settings frame, encoded once per document and shared by every
connection. None until the first document is published; a
connection that attaches later reads the current one.
browser_host: Option<Arc<dyn BrowserHost>>The server’s browser fleet, when one is installed: the connection
attaches viewers, routes input and takes the controller role through
it. None is a transport with no fleet (tests, a platform with no
CEF host), where a viewer’s attach answers its refusal.
heartbeat: HeartbeatThe socket’s keepalive: how often a connection is asked to prove it is there, and how long it may stay silent before it is reaped.
Implementations§
Source§impl TransportState
impl TransportState
Sourcepub fn for_workspace(workspace: &Arc<Workspace>) -> Self
pub fn for_workspace(workspace: &Arc<Workspace>) -> Self
The state a running forge serves its socket from, derived from the core it is a view of.
One place, so the pieces cannot drift apart. Every field here is something the socket needs that the workspace owns or that is the transport’s own.
Sourcepub fn with_heartbeat(self, heartbeat: Heartbeat) -> Self
pub fn with_heartbeat(self, heartbeat: Heartbeat) -> Self
TransportState::for_workspace with the keepalive shortened, so a
test can watch a silent peer be reaped without waiting a minute of
real time. Production builds never see it.
Auto Trait Implementations§
impl !Freeze for TransportState
impl !RefUnwindSafe for TransportState
impl !UnwindSafe for TransportState
impl Send for TransportState
impl Sync for TransportState
impl Unpin for TransportState
impl UnsafeUnpin for TransportState
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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