pub struct AuthForm { /* private fields */ }Expand description
Escaped view data for the PHP auth card and its forms.
Pass this value under the auth key to adminlte::auth.form, alongside a
resolved layout. The application owns the target route and CSRF validation.
use oxblade_adminlte::{AuthForm, AuthKind};
let form = AuthForm::new(AuthKind::SignIn, "/login".parse()?, "example-csrf")?;
let _ = form;Implementations§
Source§impl AuthForm
impl AuthForm
Sourcepub fn new(
kind: AuthKind,
action: SafeUrl,
csrf: &str,
) -> Result<Self, AuthFormError>
pub fn new( kind: AuthKind, action: SafeUrl, csrf: &str, ) -> Result<Self, AuthFormError>
Builds an auth card with the app’s validated POST action and CSRF token.
use oxblade_adminlte::{AuthForm, AuthKind};
assert!(AuthForm::new(AuthKind::Register, "/register".parse()?, "csrf").is_ok());Sourcepub fn old(self, name: &str, email: &str, remember: bool) -> Self
pub fn old(self, name: &str, email: &str, remember: bool) -> Self
Preserves the app’s old name, email and remember input, never a password.
use oxblade_adminlte::{AuthForm, AuthKind};
let _form = AuthForm::new(AuthKind::SignIn, "/login".parse()?, "csrf")?
.old("", "reader@example.test", true);Sourcepub fn with_error(self, name: &str, message: impl Into<String>) -> Self
pub fn with_error(self, name: &str, message: impl Into<String>) -> Self
Shows an app-provided plain-text validation message beside an input.
use oxblade_adminlte::{AuthForm, AuthKind};
let _form = AuthForm::new(AuthKind::SignIn, "/login".parse()?, "csrf")?
.with_error("email", "Enter an email address");Trait Implementations§
Auto Trait Implementations§
impl Forget for AuthForm
impl Freeze for AuthFormwhere
&'static str: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Field>: Freeze,
impl Move for AuthForm
impl RefUnwindSafe for AuthForm
impl Send for AuthForm
impl Sync for AuthFormwhere
RawVecInner: Sync,
impl Unpin for AuthForm
impl UnsafeUnpin for AuthFormwhere
&'static str: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Field>: UnsafeUnpin,
impl UnwindSafe for AuthForm
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoViewData for Twhere
T: Serialize,
impl<T> IntoViewData for Twhere
T: Serialize,
Source§fn into_view_data(self) -> ViewData
fn into_view_data(self) -> ViewData
Converts the value into view data.