Skip to main content

Event

Enum Event 

Source
pub enum Event {
Show 41 variants ServerConnected { properties: Value, }, ServerHeartbeat { properties: Value, }, ServerInstanceDisposed { properties: Value, }, GlobalDisposed { properties: Value, }, SessionCreated { properties: SessionInfoProps, }, SessionUpdated { properties: SessionInfoProps, }, SessionDeleted { properties: SessionInfoProps, }, SessionDiff { properties: Value, }, SessionError { properties: SessionErrorProps, }, SessionCompacted { properties: Value, }, SessionStatus { properties: Value, }, SessionIdle { properties: SessionIdleProps, }, MessageUpdated { properties: MessageUpdatedProps, }, MessageRemoved { properties: MessageRemovedProps, }, MessagePartUpdated { properties: Box<MessagePartEventProps>, }, MessagePartRemoved { properties: Value, }, PtyCreated { properties: Value, }, PtyUpdated { properties: Value, }, PtyExited { properties: Value, }, PtyDeleted { properties: Value, }, PermissionUpdated { properties: Value, }, PermissionReplied { properties: PermissionRepliedProps, }, PermissionAsked { properties: PermissionAskedProps, }, PermissionRepliedNext { properties: PermissionRepliedProps, }, ProjectUpdated { properties: Value, }, FileEdited { properties: Value, }, FileWatcherUpdated { properties: Value, }, VcsBranchUpdated { properties: Value, }, LspUpdated { properties: Value, }, LspClientDiagnostics { properties: Value, }, CommandExecuted { properties: Value, }, McpToolsChanged { properties: Value, }, InstallationUpdated { properties: Value, }, InstallationUpdateAvailable { properties: Value, }, IdeInstalled { properties: Value, }, TuiPromptAppend { properties: Value, }, TuiCommandExecute { properties: Value, }, TuiToastShow { properties: Value, }, TuiSessionSelect { properties: Value, }, TodoUpdated { properties: Value, }, Unknown,
}
Expand description

SSE Event from OpenCode server (40 variants).

Variants§

§

ServerConnected

Server connection established.

Fields

§properties: Value

Event properties.

§

ServerHeartbeat

Server heartbeat (sent periodically).

Fields

§properties: Value

Event properties.

§

ServerInstanceDisposed

Server instance disposed.

Fields

§properties: Value

Event properties.

§

GlobalDisposed

Global disposed.

Fields

§properties: Value

Event properties.

§

SessionCreated

Session created.

Fields

§properties: SessionInfoProps

Event properties with full session info.

§

SessionUpdated

Session updated.

Fields

§properties: SessionInfoProps

Event properties with full session info.

§

SessionDeleted

Session deleted.

Fields

§properties: SessionInfoProps

Event properties with full session info.

§

SessionDiff

Session diff.

Fields

§properties: Value

Event properties.

§

SessionError

Session error.

Fields

§properties: SessionErrorProps

Event properties with typed error.

§

SessionCompacted

Session compacted.

Fields

§properties: Value

Event properties.

§

SessionStatus

Session status changed.

Fields

§properties: Value

Event properties.

§

SessionIdle

Session became idle.

Fields

§properties: SessionIdleProps

Event properties with session ID.

§

MessageUpdated

Message updated.

Fields

§properties: MessageUpdatedProps

Event properties with full message info.

§

MessageRemoved

Message removed.

Fields

§properties: MessageRemovedProps

Event properties with session and message IDs.

§

MessagePartUpdated

Message part updated (streaming).

Fields

§properties: Box<MessagePartEventProps>

Event properties (boxed to reduce enum size).

§

MessagePartRemoved

Message part removed.

Fields

§properties: Value

Event properties.

§

PtyCreated

PTY created.

Fields

§properties: Value

Event properties.

§

PtyUpdated

PTY updated.

Fields

§properties: Value

Event properties.

§

PtyExited

PTY exited.

Fields

§properties: Value

Event properties.

§

PtyDeleted

PTY deleted.

Fields

§properties: Value

Event properties.

§

PermissionUpdated

Permission updated.

Fields

§properties: Value

Event properties.

§

PermissionReplied

Permission replied.

Fields

§properties: PermissionRepliedProps

Event properties with reply info.

§

PermissionAsked

Permission asked.

Fields

§properties: PermissionAskedProps

Event properties with permission request.

§

PermissionRepliedNext

Permission replied next.

Fields

§properties: PermissionRepliedProps

Event properties with reply info.

§

ProjectUpdated

Project updated.

Fields

§properties: Value

Event properties.

§

FileEdited

File edited.

Fields

§properties: Value

Event properties.

§

FileWatcherUpdated

File watcher updated.

Fields

§properties: Value

Event properties.

§

VcsBranchUpdated

VCS branch updated.

Fields

§properties: Value

Event properties.

§

LspUpdated

LSP updated.

Fields

§properties: Value

Event properties.

§

LspClientDiagnostics

LSP client diagnostics.

Fields

§properties: Value

Event properties.

§

CommandExecuted

Command executed.

Fields

§properties: Value

Event properties.

§

McpToolsChanged

MCP tools changed.

Fields

§properties: Value

Event properties.

§

InstallationUpdated

Installation updated.

Fields

§properties: Value

Event properties.

§

InstallationUpdateAvailable

Installation update available.

Fields

§properties: Value

Event properties.

§

IdeInstalled

IDE installed.

Fields

§properties: Value

Event properties.

§

TuiPromptAppend

TUI prompt append.

Fields

§properties: Value

Event properties.

§

TuiCommandExecute

TUI command execute.

Fields

§properties: Value

Event properties.

§

TuiToastShow

TUI toast show.

Fields

§properties: Value

Event properties.

§

TuiSessionSelect

TUI session select.

Fields

§properties: Value

Event properties.

§

TodoUpdated

Todo updated.

Fields

§properties: Value

Event properties.

§

Unknown

Fallback for unknown event types.

Implementations§

Source§

impl Event

Source

pub fn session_id(&self) -> Option<&str>

Extract session_id if present in this event.

Source

pub fn is_heartbeat(&self) -> bool

Check if this is a heartbeat event.

Source

pub fn is_connected(&self) -> bool

Check if this is a connection event.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

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

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

impl<'de> Deserialize<'de> for Event

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 Event

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§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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