pub struct Layout { /* private fields */ }Expand description
Typed settings for the PHP layout helper and shell.
This type can be deserialized from application configuration. Missing keys retain the defaults.
use oxblade_adminlte::Layout;
assert!(Layout::default().view("en").body_classes().contains("layout-fixed"));Implementations§
Source§impl Layout
impl Layout
Sourcepub fn view(&self, locale: &str) -> LayoutView
pub fn view(&self, locale: &str) -> LayoutView
Resolve request-local language and layout tokens, as PHP’s LayoutHelper does.
let page = oxblade_adminlte::Layout::default().view("en_US");
assert_eq!(page.body_classes(), "layout-fixed sidebar-expand-lg sidebar-mini bg-body-tertiary");Sourcepub fn view_with_assets(&self, locale: &str, assets: &AssetConfig) -> LayoutView
pub fn view_with_assets(&self, locale: &str, assets: &AssetConfig) -> LayoutView
Resolves the view using the selected AdminLTE palette from the PHP asset settings.
let assets = oxblade_adminlte::AssetConfig::default();
let view = oxblade_adminlte::Layout::default().view_with_assets("ar", &assets);
assert!(view.rtl());Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
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
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layout
impl Move for Layout
impl RefUnwindSafe for Layout
impl Send for Layoutwhere
RawVecInner: Send,
impl Sync for Layoutwhere
RawVecInner: Sync,
impl Unpin for Layout
impl UnsafeUnpin for Layoutwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Layoutwhere
RawVecInner: UnwindSafe,
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