Struct fastly::Dictionary [−][src]
A Compute@Edge Dictionary.
Implementations
impl Dictionary
[src]
pub fn open(name: &str) -> Self
[src]
Open a dictionary, given its name.
Examples
let merriam = Dictionary::open("merriam webster"); let oed = Dictionary::open("oxford english dictionary");
pub fn get(&self, key: &str) -> Option<String>
[src]
Lookup a value in this dictionary.
If successful, this function returns Some(_)
if an entry was found, or None
if no entry
with the given key was found.
Examples
assert_eq!( dictionary.get("bread"), Some(String::from("a usually baked and leavened food")), ); assert_eq!( dictionary.get("freedom"), Some(String::from("the absence of necessity, coercion, or constraint")), ); // Otherwise, `get` will return nothing. assert!(dictionary.get("zzzzz").is_none());
pub fn contains(&self, key: &str) -> bool
[src]
Return true if the dictionary contains an entry with the given key.
Examples
assert!(dictionary.contains("key"));
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,