pub struct AdminSettings {
pub site_title: String,
pub site_header: String,
pub list_per_page: usize,
pub login_url: String,
pub logout_url: String,
pub csp: AdminCspSettings,
pub security: AdminSecuritySettings,
}Available on
server only.Expand description
Top-level admin panel settings.
Combines UI configuration, CSP directives, and security headers into a single settings struct that can be deserialized from TOML. All fields have sensible defaults, so partial TOML is fully supported.
§Examples
use reinhardt_admin::settings::AdminSettings;
let settings = AdminSettings::default();
assert_eq!(settings.site_title, "Reinhardt Admin");
assert_eq!(settings.list_per_page, 100);Fields§
§site_title: StringTitle displayed in the admin panel browser tab.
site_header: StringHeader text displayed at the top of the admin panel.
list_per_page: usizeNumber of items per page in list views.
login_url: StringURL path for the admin login page.
logout_url: StringURL path for the admin logout page.
csp: AdminCspSettingsContent Security Policy settings.
security: AdminSecuritySettingsSecurity header settings.
Implementations§
Source§impl AdminSettings
impl AdminSettings
Sourcepub fn to_security_headers(&self) -> SecurityHeaders
pub fn to_security_headers(&self) -> SecurityHeaders
Build SecurityHeaders from these settings.
Converts the TOML-friendly string configuration into the typed security headers used by the admin SPA handler.
Trait Implementations§
Source§impl Clone for AdminSettings
impl Clone for AdminSettings
Source§fn clone(&self) -> AdminSettings
fn clone(&self) -> AdminSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdminSettings
impl Debug for AdminSettings
Source§impl Default for AdminSettings
impl Default for AdminSettings
Source§impl<'de> Deserialize<'de> for AdminSettings
impl<'de> Deserialize<'de> for AdminSettings
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 PartialEq for AdminSettings
impl PartialEq for AdminSettings
Source§impl Serialize for AdminSettings
impl Serialize for AdminSettings
Source§impl SettingsFragment for AdminSettings
impl SettingsFragment for AdminSettings
Source§type Accessor = dyn HasAdminSettings
type Accessor = dyn HasAdminSettings
The accessor trait for this fragment. Read more
Source§fn validate(&self, profile: &Profile) -> ValidationResult
fn validate(&self, profile: &Profile) -> ValidationResult
Validate this fragment against the given profile. Read more
Source§fn field_policies() -> &'static [FieldPolicy]
fn field_policies() -> &'static [FieldPolicy]
Returns the default field policies defined by the library author. Read more
Source§impl SettingsValidation for AdminSettings
impl SettingsValidation for AdminSettings
impl StructuralPartialEq for AdminSettings
Auto Trait Implementations§
impl Freeze for AdminSettings
impl RefUnwindSafe for AdminSettings
impl Send for AdminSettings
impl Sync for AdminSettings
impl Unpin for AdminSettings
impl UnsafeUnpin for AdminSettings
impl UnwindSafe for AdminSettings
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more