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§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphSlot
impl !UnwindSafe for GraphSlot
impl Freeze for GraphSlot
impl Send for GraphSlot
impl Sync for GraphSlot
impl Unpin for GraphSlot
impl UnsafeUnpin for GraphSlot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more