Skip to main content

PlatformBound

Enum PlatformBound 

Source
pub enum PlatformBound {
Show 29 variants SessionHello(SessionHello), SessionHeartbeat(Empty), DeviceSnapshot(DeviceSnapshotResponse), ServiceList(ServiceListResponse), ServiceAction(ServiceActionResponse), ServiceLogs(ServiceLogsResponse), BundleList(BundleListResponse), AgentProviders(AgentProvidersResponse), AgentTurnAccepted(AgentTurnAccepted), AgentTurnEvent(AgentEvent), TerminalSpawned(TerminalSpawned), TerminalSessions(TerminalSessionsResponse), TerminalAttachAccepted(TerminalAttachAccepted), TerminalOutput(TerminalOutput), TerminalGeometry(TerminalGeometry), TerminalAck(TerminalAck), TerminalClosed(TerminalClosed), TerminalKilled(TerminalKilled), Repositories(RepositoriesResponse), GithubRuns(GithubRunsResponse), GithubRunJobs(GithubRunJobsResponse), GithubPulls(GithubPullsResponse), GithubPull(GithubPullResponse), Linear(Box<LinearResponse>), AgentUsage(AgentUsageResponse), Errors(ErrorsResponse), Timeline(TimelineResponse), DeviceRetire(DeviceRetire), CommandError(CommandErrorResponse),
}
Expand description

One frame travelling daemon → platform.

Variants§

§

SessionHello(SessionHello)

The first frame on every socket. Until this arrives the connection has a credential but no identity, and routes nothing.

§

SessionHeartbeat(Empty)

Liveness, every super::limits::HEARTBEAT_INTERVAL. Missing them for super::limits::PRESENCE_TIMEOUT marks the device offline, which suspends routing rather than queueing.

§

DeviceSnapshot(DeviceSnapshotResponse)

§

ServiceList(ServiceListResponse)

§

ServiceAction(ServiceActionResponse)

§

ServiceLogs(ServiceLogsResponse)

§

BundleList(BundleListResponse)

§

AgentProviders(AgentProvidersResponse)

§

AgentTurnAccepted(AgentTurnAccepted)

The turn was accepted and has an id. Sent before any run event, so a phone always knows the run it is about to watch.

§

AgentTurnEvent(AgentEvent)

One sequenced event from a run.

§

TerminalSpawned(TerminalSpawned)

An agent terminal was started, and this is it. v2.

§

TerminalSessions(TerminalSessionsResponse)

The agent terminals that could be mirrored. v2.

§

TerminalAttachAccepted(TerminalAttachAccepted)

The mirror is open, and this is its id. v2.

§

TerminalOutput(TerminalOutput)

A coalesced chunk of what the terminal drew. v2.

§

TerminalGeometry(TerminalGeometry)

The mirrored session was resized on the machine. v2.

§

TerminalAck(TerminalAck)

A terminal command was carried out and had nothing to report. v2.

§

TerminalClosed(TerminalClosed)

The mirror ended. v2.

§

TerminalKilled(TerminalKilled)

The session was ended, and the agent in it stopped.

§

Repositories(RepositoriesResponse)

The repositories this machine has registered.

§

GithubRuns(GithubRunsResponse)

Recent GitHub Actions runs.

§

GithubRunJobs(GithubRunJobsResponse)

One run’s jobs.

§

GithubPulls(GithubPullsResponse)

Pull requests on the selected repository.

§

GithubPull(GithubPullResponse)

One pull request.

§

Linear(Box<LinearResponse>)

Boxed: the variant is ~1500 bytes against ~270 for the next largest, so every PlatformBound on the socket would carry that width. Box is transparent to serde, so the wire format is unchanged.

§

AgentUsage(AgentUsageResponse)

What the agents have spent.

§

Errors(ErrorsResponse)

The error inbox.

§

Timeline(TimelineResponse)

The runtime timeline.

§

DeviceRetire(DeviceRetire)

This machine is unpairing itself, and asks to be retired.

Device-initiated, and answers nothing. Every other frame in this union is either a reply or an event about work the platform asked for; this one is the machine saying it has thrown its own credential away and would like the row to go with it. Revocation stays the platform’s to perform and remains one-way — the device asks, it does not do.

Unsolicited rather than a reply to some device.retire.request, because there is no version of this the platform initiates: the credential is deleted on the machine by somebody standing at it.

Nothing depends on it arriving. An older platform does not know this name and refuses it, by the same fail-closed rule as any unknown frame, and the machine unpairs locally regardless. A retirement that did not land leaves exactly what leaving this frame out always left: a device row the owner can revoke from their phone.

§

CommandError(CommandErrorResponse)

A refusal. Always carries replyTo, because an error with nothing to answer is a log line, not a frame.

Implementations§

Source§

impl PlatformBound

Source

pub const KINDS: &'static [&'static str]

Every accepted type, in the order the union declares them.

Source

pub fn kind(&self) -> &'static str

Source

pub fn requires_reply_to(&self) -> bool

Whether this frame must name the request it answers.

Unsolicited frames — hello, heartbeat, run events — must not carry replyTo, and answers must. Enforced rather than assumed, because a response that arrives with no correlation is one the relay would have to guess a destination for, and guessing means fanning a private answer to the wrong browser.

Source

pub fn parse(kind: &str, payload: Value) -> Result<Self, ProtocolError>

Parse one frame’s type and payload. Same two-failure split as super::device_bound::DeviceBound::parse.

Source

pub fn payload(&self) -> Value

The payload half of the envelope.

Trait Implementations§

Source§

impl Clone for PlatformBound

Source§

fn clone(&self) -> PlatformBound

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlatformBound

Source§

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

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

impl<'de> Deserialize<'de> for PlatformBound

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 PartialEq for PlatformBound

Source§

fn eq(&self, other: &PlatformBound) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PlatformBound

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

impl StructuralPartialEq for PlatformBound

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.