pub struct IntentRegistry { /* private fields */ }Expand description
Registry of named intents. Stored in Lua app_data.
Initialized with 8 builtin Internal tools. Components can register
additional intents at runtime via orcs.register_intent().
Uses Vec for ordered iteration and HashMap<String, usize> index
for O(1) name lookup.
For IntentResolver::Internal tools, the registry also stores
Arc<dyn RustTool> instances for direct Rust dispatch (no Lua roundtrip).
Implementations§
Source§impl IntentRegistry
impl IntentRegistry
Sourcepub fn get(&self, name: &str) -> Option<&IntentDef>
pub fn get(&self, name: &str) -> Option<&IntentDef>
Look up an intent definition by name. O(1).
Sourcepub fn get_tool(&self, name: &str) -> Option<&Arc<dyn RustTool>>
pub fn get_tool(&self, name: &str) -> Option<&Arc<dyn RustTool>>
Look up a RustTool by name. O(1).
Sourcepub fn register(&mut self, def: IntentDef) -> Result<(), String>
pub fn register(&mut self, def: IntentDef) -> Result<(), String>
Register a new intent definition. Returns error if name is already taken.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IntentRegistry
impl !RefUnwindSafe for IntentRegistry
impl Send for IntentRegistry
impl Sync for IntentRegistry
impl Unpin for IntentRegistry
impl UnsafeUnpin for IntentRegistry
impl !UnwindSafe for IntentRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more