Skip to main content

EventView

Struct EventView 

Source
pub struct EventView<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> EventView<'a>

Source

pub unsafe fn from_raw(raw: &'a StablePluginEvent) -> Self

Create a view at an ABI callback boundary.

§Safety

The host must initialize the payload variant specified by tag and keep every payload buffer valid until the callback returns. The view borrows the event; accessors copy strings and never free host memory.

Source

pub fn tag(&self) -> EventTag

Source

pub fn message_text(&self) -> Option<String>

Source

pub fn data_text(&self) -> Option<String>

Source

pub fn tool_call(&self) -> Option<ToolCall>

Source

pub fn tool_result(&self) -> Option<ToolResult>

Auto Trait Implementations§

§

impl<'a> Freeze for EventView<'a>

§

impl<'a> RefUnwindSafe for EventView<'a>

§

impl<'a> Send for EventView<'a>

§

impl<'a> Sync for EventView<'a>

§

impl<'a> Unpin for EventView<'a>

§

impl<'a> UnsafeUnpin for EventView<'a>

§

impl<'a> UnwindSafe for EventView<'a>

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