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>>>,
}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
Implementations§
Source§impl AppState
impl AppState
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
Returns the link-specific auth policy if defined, otherwise returns None to indicate that entity-level permissions should be used.
§Arguments
link_definition- The link definition to checkoperation- The operation type: “list”, “create”, or “delete”
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 !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