pub struct AppState {
pub link_service: Arc<dyn LinkService>,
pub config: Arc<LinksConfig>,
pub registry: Arc<LinkRouteRegistry>,
pub entity_fetchers: Arc<HashMap<String, Arc<dyn EntityFetcher>>>,
pub entity_creators: Arc<HashMap<String, Arc<dyn EntityCreator>>>,
pub event_bus: Option<Arc<EventBus>>,
}Expand description
Application state shared across handlers
Fields§
§link_service: Arc<dyn LinkService>§config: Arc<LinksConfig>§registry: Arc<LinkRouteRegistry>§entity_fetchers: Arc<HashMap<String, Arc<dyn EntityFetcher>>>Entity fetchers for enriching links with full entity data
entity_creators: Arc<HashMap<String, Arc<dyn EntityCreator>>>Entity creators for creating new entities with automatic linking
event_bus: Option<Arc<EventBus>>Optional event bus for publishing real-time events
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn publish_event(&self, event: FrameworkEvent)
pub fn publish_event(&self, event: FrameworkEvent)
Publish an event to the event bus (if configured)
This is non-blocking and fire-and-forget. If there are no subscribers or no event bus configured, the event is silently dropped.
Sourcepub fn get_link_auth_policy(
link_definition: &LinkDefinition,
operation: &str,
) -> Option<String>
pub fn get_link_auth_policy( link_definition: &LinkDefinition, operation: &str, ) -> Option<String>
Get the authorization policy for a link operation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
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