Skip to main content

Response

Enum Response 

Source
pub enum Response {
Show 22 variants Sessions(Vec<TearSession>), Session(TearSession), Window { session: SessionId, window: TearWindow, }, Pane(TearPane), SessionId(SessionId), WindowId(WindowId), PaneId(PaneId), PaneSnapshot(PaneSnapshot), PaneBytes(Vec<u8>), PaneClosed(PaneId), ConfigYaml(String), CastJson(String), RecordingStatus { enabled: bool, events: u32, }, Blocks(Vec<Block>), Block(Block), BlocksStatus { total: u32, in_progress: bool, }, SubscriberCount(u32), Freio { sessions: Vec<(SessionId, Freio)>, braked: Vec<PaneId>, unbrakable: Vec<PaneId>, }, ConfigChanged(String), Hello(DaemonHello), Ok, Err(WireError),
}
Expand description

Reply shape for every Request variant. The daemon always emits exactly one Response per Request — there is no streaming or multi-frame reply at this layer (subscription / event streams will land in a separate Notification type in Phase 2).

Variants§

§

Sessions(Vec<TearSession>)

§

Session(TearSession)

§

Window

Fields

§session: SessionId
§window: TearWindow
§

Pane(TearPane)

§

SessionId(SessionId)

§

WindowId(WindowId)

§

PaneId(PaneId)

§

PaneSnapshot(PaneSnapshot)

§

PaneBytes(Vec<u8>)

Pushed by the daemon after a successful Subscribe — one frame per PTY chunk. Bytes are exactly what the PTY master reader delivered; consumers feed them into their own vte parser (or into a tear-core PaneGrid client-side).

§

PaneClosed(PaneId)

Pushed by the daemon when the subscribed pane is destroyed. Subscribers should disconnect after observing this.

§

ConfigYaml(String)

Reply to Request::GetConfig — the daemon’s current live TearConfig serialised as YAML (the same on-disk format operators author at ~/.config/tear/tear.yaml). Wire stays in tear-types; deserialization back to a typed TearConfig happens in tear-client / consumer code which already depends on tear-config. YAML over the wire (vs typed CBOR) avoids the cycle tear-types ↔ tear-config and keeps the daemon’s config inspectable with any text tool.

§

CastJson(String)

Reply to Request::ExportPaneRecording — asciinema v2 .cast (JSON-lines) string ready to write to disk or pipe to asciinema play.

§

RecordingStatus

Reply to Request::PaneRecordingStatus.

Fields

§enabled: bool
§events: u32
§

Blocks(Vec<Block>)

Reply to Request::PaneBlocksList.

§

Block(Block)

Reply to Request::PaneBlockAt.

§

BlocksStatus

Reply to Request::PaneBlocksStatus.

Fields

§total: u32
§in_progress: bool
§

SubscriberCount(u32)

Reply to Request::PaneSubscriberCount — number of currently-attached byte-stream subscribers for that pane. Includes the requester if it has an outstanding subscribe.

§

Freio

Reply to Request::SetFreio / Request::GetFreio.

Fields

§sessions: Vec<(SessionId, Freio)>

Every session’s brake state after the call.

§braked: Vec<PaneId>

Panes this call actually braked.

§unbrakable: Vec<PaneId>

★ Panes the brake could NOT reach, because their provenance is unknown (a tmux-backend pane, a pane from a pre-yurai daemon).

Never elided and never empty-by-convention. An operator who pressed a panic button must be told what it did not stop; silence here would let them believe everything halted. This is the honest cost of not braking Unknown panes — see crate::session::TearSession::admits.

§

ConfigChanged(String)

Pushed by the daemon on every live-config replace, to every connection that issued Request::SubscribeConfigChange. Payload is the new config as YAML — same shape as Response::ConfigYaml. The first frame after subscription is Response::Ok; subsequent frames are ConfigChanged until the connection is dropped.

§

Hello(DaemonHello)

Reply to Request::Hello — the daemon’s own version plus the wire names of every capability it implements.

Adding a Response variant is safe in a way adding a Request variant is not: only a new daemon emits this, and only in reply to a probe an old client never sends. The asymmetry is why the negotiation could be added at all without a flag day.

§

Ok

§

Err(WireError)

Trait Implementations§

Source§

impl Clone for Response

Source§

fn clone(&self) -> Response

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 Response

Source§

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

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

impl<'de> Deserialize<'de> for Response

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 Response

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
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.