pub struct BeanRegistry { /* private fields */ }Expand description
A thread-safe registry for named bean processors.
Uses Arc<Mutex<...>> internally so that register() and lookup()
can be called from multiple threads without external synchronisation.
Implementations§
Source§impl BeanRegistry
impl BeanRegistry
pub fn new() -> Self
Sourcepub fn register<B>(
&self,
name: impl Into<String>,
bean: B,
) -> Result<(), BeanError>where
B: BeanProcessor + 'static,
pub fn register<B>(
&self,
name: impl Into<String>,
bean: B,
) -> Result<(), BeanError>where
B: BeanProcessor + 'static,
Register a bean under the given name.
Returns Err(BeanError::DuplicateName) if a bean with the same name
already exists, or Err(BeanError::InvalidName) if the name is blank.
pub fn get(&self, name: &str) -> Option<Arc<dyn BeanProcessor>>
pub async fn invoke( &self, bean_name: &str, method: &str, exchange: &mut Exchange, ) -> Result<(), CamelError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BeanRegistry
impl RefUnwindSafe for BeanRegistry
impl Send for BeanRegistry
impl Sync for BeanRegistry
impl Unpin for BeanRegistry
impl UnsafeUnpin for BeanRegistry
impl UnwindSafe for BeanRegistry
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