pub struct SiteSettingSchema {
pub scope: &'static str,
pub label: &'static str,
pub fields: fn() -> Vec<Widget>,
}Expand description
A typed schema for one settings scope: a human label + the list
of typed fields editors fill in (instead of raw JSON). Host crates
register one per scope via crate::register_site_setting!.
fields returns a fresh Vec<Widget> each call so the admin can
prefill values into the clones without mutating shared state. Each
field name becomes a key in the stored value_json object, and
its WidgetKind drives both the rendered input and how the
submitted string is coerced back into JSON (see
value_json_from_form).
Fields§
§scope: &'static str§label: &'static str§fields: fn() -> Vec<Widget>Trait Implementations§
impl Collect for SiteSettingSchema
Auto Trait Implementations§
impl Forget for SiteSettingSchema
impl Freeze for SiteSettingSchema
impl RefUnwindSafe for SiteSettingSchema
impl Send for SiteSettingSchema
impl Sync for SiteSettingSchema
impl Unpin for SiteSettingSchema
impl UnsafeUnpin for SiteSettingSchema
impl UnwindSafe for SiteSettingSchema
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
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> 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 moreCreates a shared type from an unshared type.