pub struct HeaderActions { /* private fields */ }Expand description
The HeaderActions a page or a resource declares, in button order.
let actions = HeaderActions::new().add::<ClearCache>();Implementations§
Source§impl HeaderActions
impl HeaderActions
Sourcepub fn add<A: HeaderAction>(self) -> Self
pub fn add<A: HeaderAction>(self) -> Self
Appends the action A, failing to compile when A::NAME is not a single path segment.
The check is a constant evaluated when A is instantiated, so cargo check does not
report it; cargo build does. The doctest builds the program. Its E0080 names the
error, but rustdoc checks the code on nightly only.
ⓘ
struct ClearCache;
impl HeaderAction for ClearCache {
type Input = ();
const NAME: &'static str = "clear cache";
async fn run(_: &Cx, _: (), _: &mut dyn toasty::Executor) -> Result<tablo_core::Outcome, tablo_core::WriteError> {
Ok(tablo_core::Outcome::done())
}
}
let _actions = HeaderActions::new().add::<ClearCache>();Trait Implementations§
Source§impl Debug for HeaderActions
impl Debug for HeaderActions
Auto Trait Implementations§
impl Freeze for HeaderActions
impl RefUnwindSafe for HeaderActions
impl Send for HeaderActions
impl Sync for HeaderActions
impl Unpin for HeaderActions
impl UnsafeUnpin for HeaderActions
impl UnwindSafe for HeaderActions
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