pub enum EditMode {
View,
Edit,
}Expand description
Which display mode the component uses.
Set from a URL query parameter — typically ?mode=edit — by
EditMode::from_query. Defaults to EditMode::View.
Variants§
View
Read-only display with a “Modifica” action.
Edit
Inline-edit form with “Salva” / “Annulla” actions.
Implementations§
Source§impl EditMode
impl EditMode
Sourcepub fn from_query(raw: Option<&str>) -> Self
pub fn from_query(raw: Option<&str>) -> Self
Parse a URL query-parameter value into an EditMode.
Returns EditMode::Edit when raw equals "edit" (ASCII
case-insensitive); EditMode::View otherwise, including when
raw is None or any other string.
Handlers typically call this with req.query("mode").as_deref().
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EditMode
impl<'de> Deserialize<'de> for EditMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for EditMode
impl JsonSchema for EditMode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl Copy for EditMode
impl Eq for EditMode
impl StructuralPartialEq for EditMode
Auto Trait Implementations§
impl Freeze for EditMode
impl RefUnwindSafe for EditMode
impl Send for EditMode
impl Sync for EditMode
impl Unpin for EditMode
impl UnsafeUnpin for EditMode
impl UnwindSafe for EditMode
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