pub struct WebProjectContext {
pub current_project: Option<Project>,
pub projects: Vec<Project>,
pub projects_enabled: bool,
}Expand description
Extracts current project context from cookie
Fields§
§current_project: Option<Project>§projects: Vec<Project>§projects_enabled: boolImplementations§
Source§impl WebProjectContext
impl WebProjectContext
pub fn project_id(&self) -> Option<i64>
Sourcepub fn is_current_project(&self, id: &i64) -> bool
pub fn is_current_project(&self, id: &i64) -> bool
Check if the given project ID is the current project (for template use)
Sourcepub fn show_selector(&self) -> bool
pub fn show_selector(&self) -> bool
Returns true if project selector should be shown (more than 1 project)
Trait Implementations§
Source§impl Clone for WebProjectContext
impl Clone for WebProjectContext
Source§fn clone(&self) -> WebProjectContext
fn clone(&self) -> WebProjectContext
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 moreAuto Trait Implementations§
impl Freeze for WebProjectContext
impl RefUnwindSafe for WebProjectContext
impl Send for WebProjectContext
impl Sync for WebProjectContext
impl Unpin for WebProjectContext
impl UnsafeUnpin for WebProjectContext
impl UnwindSafe for WebProjectContext
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