Skip to main content

ServerMessage

Enum ServerMessage 

Source
pub enum ServerMessage {
Show 22 variants Pong, Settings { document: SettingsDocument, }, SettingsRefused { reason: SettingsRefusal, message: String, id: u64, key_path: Option<String>, }, SettingsSaved { id: u64, }, Greeting { version: u32, forge_version: String, forge_version_short: String, settings: ClientSettings, }, Snapshot { subject: Subject, data: Value, }, Update { update: Box<SessionUpdate>, seq: Option<u64>, span: u64, }, Page { conversation: SessionSlot, turns: Vec<TurnWire>, cursor: Option<String>, cron_names: BTreeMap<String, CronName>, }, SeatFrames { slot: SessionSlot, epoch: Option<SessionId>, frames: Vec<SeatFrameWire>, }, CommitDiff { sha: String, files: LayerState<Vec<FileContent>>, truncated: bool, }, FileContent { session: SessionSlot, path: String, sha: Option<String>, content: FileContentWire, }, Reply { reply_to: u64, body: Value, }, BrowserView { id: u16, profile: String, tab: u16, controller: Option<u64>, viewers: u32, viewer: u64, }, TerminalView { seat: SessionSlot, id: u16, cols: u16, rows: u16, seq: u32, screen: String, viewers: u32, viewer: u64, controller: Option<u64>, }, TerminalControl { seat: SessionSlot, id: u16, controller: Option<u64>, }, BrowserNavState { id: u16, tab: u16, can_back: bool, can_forward: bool, }, BrowserSurfaceFailed { id: u16, tab: u16, reason: String, }, BrowserTabs { id: u16, profile: String, up: bool, connected: bool, closing_at_ms: Option<u64>, rows: Vec<BrowserTabRow>, }, BrowserFileDialog { id: u64, tab: u16, multiple: bool, }, BrowserDownload { tab: Option<u16>, name: String, data: Option<String>, error: Option<String>, dropped: bool, lost: Option<u64>, }, Error { what: String, why: String, seat: Option<SessionSlot>, dispatch_id: Option<u64>, }, DocumentRead { session: SessionSlot, path: String, document_kind: DocumentKind, bytes: String, reviewable: bool, content_hash: String, threads: Vec<ReviewedThreadWire>, reviews: Vec<ReviewSet>, },
}
Expand description

What the server sends.

Variants§

§

Pong

The answer to ClientMessage::Ping, and proof the peer is reading.

§

Settings

The effective config, pushed once after the greeting and again after every applied reload. Server-wide rather than seat-scoped: every connection draws the same document, and a connection that attaches while a reload is in flight reads the current load here - which is why no settings read verb exists.

Fields

§

SettingsRefused

A settings save that wrote nothing. message is the loader’s own words for an invalid candidate or the guard’s own for a refusal; key_path anchors it at one of the save’s keys where one is known.

Fields

§message: String
§id: u64
§key_path: Option<String>
§

SettingsSaved

A settings save that wrote. The reload push carries the new document; this is the saver’s own acknowledgement, matched by id, so a page clears its draft only for its own save.

Fields

§id: u64
§

Greeting

Fields

§version: u32
§forge_version: String

The build that sent this, in the two forms a view’s own header draws. The greeting is the only thing a client is guaranteed to have before it reads or refuses anything, so a skew can name both halves from here and nowhere else.

§forge_version_short: String
§

Snapshot

Fields

§subject: Subject
§data: Value
§

Update

Boxed for the same reason as a command: the update is the largest thing on this wire and every other variant is small beside it.

Fields

§seq: Option<u64>

The number the frame’s oldest update was minted under, None for a frame belonging to no seat.

A client reads the numbers to see what it missed. Every frame the workspace emits for a seat is numbered on that seat’s counter, so a client that reads 5 and then 7 knows exactly one frame went missing and asks the seat for it (seat_range); the snapshot’s header.seq says where a fresh reader joins.

§span: u64

How many of the seat’s numbers this frame stands for: 1 for a frame that is one update, and n for a run the batch folded into one - a run of token appends crosses as the single frame they draw as, and its span is what keeps the client from reading the numbers it already drew as a gap.

0 only on the turn the batch forges from a delivery, which has no number; every other frame stands for at least one, the out-of-band read_call_output answer (seq: null, span: 1) included.

§

Page

A page of one conversation, in answer to more: whole turns, each with the key the server named it by and the messages it ran as. Grouping a run of calls inside a turn is the client’s, so the messages cross and no drawing of them does.

Fields

§conversation: SessionSlot
§turns: Vec<TurnWire>
§cursor: Option<String>
§cron_names: BTreeMap<String, CronName>

The schedules the fired prompts in turns came from, keyed by the prompt’s own id: what titles a cron row a page carries long after its delivery frame is gone.

§

SeatFrames

The answer to seat_range: the frames numbered in from..=to, each with the number it was minted under, oldest first.

Answered from the seat’s own window while it holds them, and from the transcript below that. A range the window has shed comes back as the conversation’s own rows numbered to END at the range’s end, so a client resumes where it was reading instead of asking again for a stretch that cannot arrive. A range from another epoch, or one forge holds no seat for, is an error naming seat_range.

§

CommitDiff

The answer to commit_diff: one commit’s own bounded diff, in the same layer shape the record’s content read carries, so a client draws both scopes through one parse.

A sha git cannot read is the scan’s own scan_failed layer, not an error - the diff-viewer contract keeps a read that answered something apart from a read that could not run, and the client draws the state as itself. Only a seat forge holds no session for is an error naming commit_diff.

Fields

§truncated: bool

Something was withheld for the read’s budget, the flag the record’s own content read carries.

§

FileContent

The answer to file_content: the file’s lines at the revision asked for, or why the read could not run.

session, path and sha are named back so a page holding two seats, two scopes or several files routes each answer to its own ask.

Fields

§session: SessionSlot
§path: String
§

Reply

The answer to a Command that carried a reply_to, including a refusal, so a client awaiting one is never left watching a channel that stays empty.

Fields

§reply_to: u64
§body: Value
§

BrowserView

One tab’s viewer state: which viewer controls it, and how many are attached.

Sent on attach and whenever either changes, so every viewer draws the same truth about who is driving. id is the profile’s wire id, the same one the binary frames carry; tab is the tab this state is for; and viewer is THIS connection’s own - the number controller names when this viewer holds the role, so a bar can say “Take control” rather than guessing.

Fields

§id: u16
§profile: String
§tab: u16
§controller: Option<u64>
§viewers: u32
§viewer: u64
§

TerminalView

One terminal’s screen, as a VT stream a client can draw, and where the byte stream continues from.

Fields

§id: u16
§cols: u16
§rows: u16
§seq: u32

The last sequence the repaint reflects; the next frame carries one above it.

§screen: String

The visible screen as a VT stream, valid UTF-8.

§viewers: u32

How many clients are attached.

§viewer: u64

This connection’s own viewer number, so a control change can say whether the holder is this viewer.

§controller: Option<u64>

The connection holding the person’s control, None when the agent does.

§

TerminalControl

Who holds a terminal’s input, pushed to every viewer of it on a take or a release.

Fields

§id: u16
§controller: Option<u64>
§

BrowserNavState

Where the viewed tab’s history sits: what the bar’s arrows may do.

Fields

§id: u16
§tab: u16
§can_back: bool
§can_forward: bool
§

BrowserSurfaceFailed

The viewed tab’s browser stopped.

A host that died under a viewer is said out loud: a frozen last frame reads as a slow page, and the person has no way to tell the two apart.

Fields

§id: u16
§tab: u16
§reason: String
§

BrowserTabs

The tabs of the viewer’s profile, as a client’s strip draws them.

Pushed to a connection that asked with browser_tabs, once per change: up is the host process, connected is a driver attached to it, and closing_at_ms is the idle clock’s deadline.

Fields

§id: u16
§profile: String
§up: bool
§connected: bool
§closing_at_ms: Option<u64>
§

BrowserFileDialog

A page asked for a file: the shell opens its picker and answers ClientMessage::BrowserFileAnswer under the same id. tab is the tab that asked, so a viewer is asked only for the one it is on.

Fields

§id: u64
§tab: u16
§multiple: bool
§

BrowserDownload

A page’s download finished on the server: the shell opens its save door and writes the bytes, or says error and writes nothing. tab is the tab it started from.

Fields

§tab: Option<u16>

The tab the download started from. Absent on a profile-level notice: the backlog carries every tab’s offers, so the ones it dropped may belong to any tab of the profile.

§name: String
§data: Option<String>

The file’s bytes, base64; absent when error says why not.

§dropped: bool

Whether the offer was dropped before the viewer read it, rather than a save that failed: the shell titles the two differently. Additive and defaulted - an older client reads the loss as the refusal it already draws.

§lost: Option<u64>

How many offers the backlog dropped. The title says one loss or many from it, so it agrees with the count in the body. Additive and absent on a save.

§

Error

Fields

§what: String
§seat: Option<SessionSlot>

The conversation the refusal belongs to, where it belongs to one: a more for a seat the server could not answer names its seat, so a client holding several seats’ asks drains only its own. Optional and additive - a client of either age reads it, and a refusal that names no seat is read the way it always was.

§dispatch_id: Option<u64>

The dispatch a refused command answered by, echoed from what the press minted: a client that holds a draft until its own dispatch answers tells this refusal from any other by it.

§

DocumentRead

One document, as the read answered: the seat it was read for, the path it resolved to, the bytes, the detected kind, the flag the hand-off passed, the document’s own hash, and the review the document already carries.

session is named back so a client holding two seats routes each answer to its own viewer - the same reason a refusal names its seat. bytes are base64: the ceiling makes a document up to a third larger than its file, well inside the socket’s own frame bound. document_kind and not kind: a field named kind collides with the envelope’s own tag.

threads and reviews are the document scope’s own (doc:<path>) store read, taken in the same handler: the viewer draws its comments, and each thread carries where its anchor sits in THIS document - the code review’s re-anchoring, resolved here because only the server holds the whole file’s lines. A thread the revision left nowhere is carried with an outdated landing rather than dropped. content_hash crosses as DECIMAL DIGITS for the same reason a thread’s anchor hash does - JS numbers are exact only to 2^53.

Fields

§session: SessionSlot
§path: String
§document_kind: DocumentKind
§bytes: String
§reviewable: bool
§content_hash: String
§reviews: Vec<ReviewSet>

Trait Implementations§

Source§

impl Debug for ServerMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ServerMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ServerMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more