pub trait PageAuth {
// Required method
fn auth(&self) -> &Authenticated;
}Expand description
What pages::chrome needs of a page extractor: the session and the operator
behind it.
A trait rather than a concrete &PageSession parameter, because a read
route may be gated on a tier (PageAdminRead) and still owe the same
navigation, CSRF token and user card as an ungated one. Only the read-side
extractors implement it — a write extractor never renders chrome, since its
answer is a fragment or a redirect.
Required Methods§
fn auth(&self) -> &Authenticated
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".