pub struct Edit {
pub form: &'static Form,
pub noun: &'static str,
pub action: &'static str,
pub page: &'static str,
pub remedy: &'static str,
}Expand description
An edit form and the page that serves it.
Fields§
§form: &'static Form§noun: &'static strThe capitalised name of the edited entity, as the error pages say it.
action: &'static str§page: &'static strThe page that loads the entity; {id} is the entity’s id.
remedy: &'static strWhat to do about a stored entity the form refuses, if anything works.
Implementations§
Source§impl Edit
impl Edit
Sourcepub async fn load(&self, user_id: Uuid, id: &str) -> Result<Loaded, WebError>
pub async fn load(&self, user_id: Uuid, id: &str) -> Result<Loaded, WebError>
The form loaded for id and rendered for posting, or the refusal.
Sourcepub async fn loaded_noticed(
&self,
user_id: Uuid,
id: &str,
) -> Result<(String, Option<String>), WebError>
pub async fn loaded_noticed( &self, user_id: Uuid, id: &str, ) -> Result<(String, Option<String>), WebError>
Edit::load for a page of its own: a refusal is its 422 page.
Sourcepub async fn loaded_form(
&self,
user_id: Uuid,
id: &str,
) -> Result<String, WebError>
pub async fn loaded_form( &self, user_id: Uuid, id: &str, ) -> Result<String, WebError>
Edit::loaded_noticed without the notice.
Sourcepub async fn saved_response(
&self,
user_id: Uuid,
id: Uuid,
message: String,
) -> Result<Response, WebError>
pub async fn saved_response( &self, user_id: Uuid, id: Uuid, message: String, ) -> Result<Response, WebError>
The saved message for the result box, with the entity’s fresh
revision swapped into the form so the next save is not stale.
Auto Trait Implementations§
impl Freeze for Edit
impl RefUnwindSafe for Edit
impl Send for Edit
impl Sync for Edit
impl Unpin for Edit
impl UnsafeUnpin for Edit
impl UnwindSafe for Edit
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more