pub struct FnApprovalHandler<F>(/* private fields */);Expand description
Approval handler backed by a closure.
Use this when the crate’s canned policies are too broad or too narrow. The
closure receives the typed ServerRequest and returns the exact reply to
send back to the app-server.
Implementations§
Source§impl<F> FnApprovalHandler<F>
impl<F> FnApprovalHandler<F>
Sourcepub fn new(handler: F) -> Self
pub fn new(handler: F) -> Self
Wraps a closure as an ApprovalHandler.
Trait Implementations§
Source§impl<F> ApprovalHandler for FnApprovalHandler<F>
impl<F> ApprovalHandler for FnApprovalHandler<F>
fn handle<'a>(&'a self, request: &'a ServerRequest) -> ApprovalFuture<'a>
Auto Trait Implementations§
impl<F> Freeze for FnApprovalHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for FnApprovalHandler<F>where
F: RefUnwindSafe,
impl<F> Send for FnApprovalHandler<F>where
F: Send,
impl<F> Sync for FnApprovalHandler<F>where
F: Sync,
impl<F> Unpin for FnApprovalHandler<F>where
F: Unpin,
impl<F> UnsafeUnpin for FnApprovalHandler<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FnApprovalHandler<F>where
F: UnwindSafe,
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