Skip to main content

GraphSlot

Struct GraphSlot 

Source
pub struct GraphSlot { /* private fields */ }
Expand description

lmflow_graph_new 先返回一个空槽,init_from_yaml 才真正建图。

输入/输出句柄(LMFlowInput*/LMFlowPoller*)不由本槽持有 —— 它们是调用方拥有的: lmflow_graph_input/lmflow_graph_add_poller 返回一个独立的 Box::into_raw 句柄, 各自持一份 Arc<GraphInner>,须由调用方 lmflow_input_free/lmflow_poller_free 释放。 这样即使先 lmflow_graph_free 了图,句柄内存依旧有效(其 Arc 撑着引擎), 之后再用只会得到「图已结束」的错误,而不是 use-after-free。

Trait Implementations§

Source§

impl Default for GraphSlot

Source§

fn default() -> GraphSlot

Returns the “default value” for a type. 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> 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 = 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.