pub struct PageContext {
pub kind: String,
pub item: Option<String>,
pub revision: Option<String>,
pub change: Option<String>,
pub request: Option<String>,
pub project: Option<String>,
pub view: Option<String>,
pub rule: Option<String>,
pub query: Option<String>,
pub filters: Vec<(String, String)>,
pub selected: Option<String>,
pub shown: Vec<String>,
}Expand description
What a page declares (see the module documentation).
Fields§
§kind: StringOne of KINDS; empty = no context.
item: Option<String>Item number.
revision: Option<String>Revision code (with item).
change: Option<String>Change order number.
request: Option<String>Change request number.
project: Option<String>Project group code.
view: Option<String>The section or tab: overview, files, bom, where-used …
rule: Option<String>The revision rule of a BOM view: latest, latest-released …
query: Option<String>The search query or list filter text.
filters: Vec<(String, String)>Further list filters (state = released …).
selected: Option<String>The selected row (an item number in the vault explorer).
shown: Vec<String>Item numbers of the rows currently shown (at most MAX_SHOWN).
Implementations§
Source§impl PageContext
impl PageContext
Sourcepub fn parse(v: &Value) -> PageContext
pub fn parse(v: &Value) -> PageContext
Reads the context a client sent. Never fails: whatever has the wrong type, characters or length is dropped, lists are capped.
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
A short description for the chip and the thread:
PRT-000009/A · BOM (latest released). Built from the fields of this
context, so call it on the resolved context only.
Sourcepub fn model_note(&self) -> String
pub fn model_note(&self) -> String
The note appended to the user’s message: where the user is. Only resolved values are in it; the model is told it is a hint.
Trait Implementations§
Source§impl Clone for PageContext
impl Clone for PageContext
Source§impl Debug for PageContext
impl Debug for PageContext
Source§impl Default for PageContext
impl Default for PageContext
impl Eq for PageContext
Source§impl PartialEq for PageContext
impl PartialEq for PageContext
Source§impl Serialize for PageContext
impl Serialize for PageContext
impl StructuralPartialEq for PageContext
Auto Trait Implementations§
impl Freeze for PageContext
impl RefUnwindSafe for PageContext
impl Send for PageContext
impl Sync for PageContext
impl Unpin for PageContext
impl UnsafeUnpin for PageContext
impl UnwindSafe for PageContext
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 moreimpl<T> Parallelizable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.