pub struct UnifiedHandler<T: KeyValueStore + 'static> { /* private fields */ }Expand description
Unified Handler for Kotoba ecosystem with KeyValueStore backend
Implementations§
Source§impl<T: KeyValueStore + 'static> UnifiedHandler<T>
impl<T: KeyValueStore + 'static> UnifiedHandler<T>
Sourcepub async fn execute(
&self,
content: &str,
context: HandlerContext,
) -> Result<String>
pub async fn execute( &self, content: &str, context: HandlerContext, ) -> Result<String>
Execute handler with given content and context
Sourcepub async fn execute_file(
&self,
file_path: &str,
context: HandlerContext,
) -> Result<String>
pub async fn execute_file( &self, file_path: &str, context: HandlerContext, ) -> Result<String>
Execute handler with file input
Sourcepub async fn update_config(&self, config: HandlerConfig)
pub async fn update_config(&self, config: HandlerConfig)
Update handler configuration
Sourcepub async fn get_config(&self) -> HandlerConfig
pub async fn get_config(&self) -> HandlerConfig
Get current handler configuration
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear cache
Sourcepub async fn cache_size(&self) -> usize
pub async fn cache_size(&self) -> usize
Get cache size
Trait Implementations§
Source§impl<T: Clone + KeyValueStore + 'static> Clone for UnifiedHandler<T>
impl<T: Clone + KeyValueStore + 'static> Clone for UnifiedHandler<T>
Source§fn clone(&self) -> UnifiedHandler<T>
fn clone(&self) -> UnifiedHandler<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: KeyValueStore + 'static> Default for UnifiedHandler<T>
impl<T: KeyValueStore + 'static> Default for UnifiedHandler<T>
Auto Trait Implementations§
impl<T> Freeze for UnifiedHandler<T>
impl<T> !RefUnwindSafe for UnifiedHandler<T>
impl<T> Send for UnifiedHandler<T>
impl<T> Sync for UnifiedHandler<T>
impl<T> Unpin for UnifiedHandler<T>
impl<T> !UnwindSafe for UnifiedHandler<T>
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