pub struct Keywords(/* private fields */);Expand description
A template instance’s keywordToValue: one value per keyword, kept in the
order the venue hashes them, which is bytewise by keyword, so Zone comes
before apple. Built sorted, so no caller can send them otherwise.
Implementations§
Source§impl Keywords
impl Keywords
Sourcepub fn from_pairs<K: Into<String>, V: Into<String>>(
pairs: impl IntoIterator<Item = (K, V)>,
) -> Result<Self, BadValue>
pub fn from_pairs<K: Into<String>, V: Into<String>>( pairs: impl IntoIterator<Item = (K, V)>, ) -> Result<Self, BadValue>
Pairs in any order. A keyword given twice is refused, not replaced.
Sourcepub fn with(
self,
keyword: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, BadValue>
pub fn with( self, keyword: impl Into<String>, value: impl Into<String>, ) -> Result<Self, BadValue>
One more pair. A keyword given twice is refused, not replaced.
pub fn get(&self, keyword: &str) -> Option<&str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &str)>
The pairs in the order they are hashed in.
Sourcepub fn check<'a>(
&self,
declared: impl IntoIterator<Item = (&'a str, Hint)>,
now_ms: u64,
) -> Vec<BadValue>
pub fn check<'a>( &self, declared: impl IntoIterator<Item = (&'a str, Hint)>, now_ms: u64, ) -> Vec<BadValue>
Everything wrong with these as an instance of a template declaring
declared, each keyword with its hint: a declared keyword with no
value, a value for a keyword it does not declare, and each value its
hint refuses at now_ms. Empty when nothing is.
Trait Implementations§
impl Eq for Keywords
impl StructuralPartialEq for Keywords
Auto Trait Implementations§
impl Freeze for Keywords
impl RefUnwindSafe for Keywords
impl Send for Keywords
impl Sync for Keywords
impl Unpin for Keywords
impl UnsafeUnpin for Keywords
impl UnwindSafe for Keywords
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.