pub struct CallbackRegistry(/* private fields */);Expand description
A curated allowlist of PHP callbacks bougie reproduces natively, mapping
"Class::method" → handler. This is not a general callback runner:
only the host-registered entries run; every other callback warn-skips.
Implementations§
Source§impl CallbackRegistry
impl CallbackRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, key: &str, handler: CallbackHandler)
pub fn register(&mut self, key: &str, handler: CallbackHandler)
Register a handler under a "Class::method" key. The key is
normalised (a single leading \ on the class is stripped) to match
how Composer entries may or may not carry the root-namespace slash.
Sourcepub fn get(&self, class: &str, method: &str) -> Option<&CallbackHandler>
pub fn get(&self, class: &str, method: &str) -> Option<&CallbackHandler>
Look up a handler for a classified Class::method callback.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for CallbackRegistry
impl Debug for CallbackRegistry
Source§impl Default for CallbackRegistry
impl Default for CallbackRegistry
Source§fn default() -> CallbackRegistry
fn default() -> CallbackRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackRegistry
impl !UnwindSafe for CallbackRegistry
impl Freeze for CallbackRegistry
impl Send for CallbackRegistry
impl Sync for CallbackRegistry
impl Unpin for CallbackRegistry
impl UnsafeUnpin for CallbackRegistry
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