[][src]Struct astrolog::Context

pub struct Context(_);

Methods

impl Context[src]

pub fn new() -> Self[src]

pub fn from_json(v: Value) -> Self[src]

pub fn set<V>(&mut self, k: &str, v: V) -> &mut Self where
    V: Serialize
[src]

pub fn with<V>(self, k: &str, v: V) -> Self where
    V: Serialize
[src]

pub fn pointer(&self, pointer: &str) -> Option<&Value>[src]

pub fn to_value(&self) -> Value[src]

pub fn as_value(&self) -> &Value[src]

Methods from Deref<Target = Map<String, Value>>

pub fn clear(&mut self)[src]

Clears the map, removing all values.

pub fn get<Q>(&self, key: &Q) -> Option<&Value> where
    Q: Ord + Eq + Hash + ?Sized,
    String: Borrow<Q>, 
[src]

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type.

pub fn contains_key<Q>(&self, key: &Q) -> bool where
    Q: Ord + Eq + Hash + ?Sized,
    String: Borrow<Q>, 
[src]

Returns true if the map contains a value for the specified key.

The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type.

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut Value> where
    Q: Ord + Eq + Hash + ?Sized,
    String: Borrow<Q>, 
[src]

Returns a mutable reference to the value corresponding to the key.

The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type.

pub fn insert(&mut self, k: String, v: Value) -> Option<Value>[src]

Inserts a key-value pair into the map.

If the map did not have this key present, None is returned.

If the map did have this key present, the value is updated, and the old value is returned.

pub fn remove<Q>(&mut self, key: &Q) -> Option<Value> where
    Q: Ord + Eq + Hash + ?Sized,
    String: Borrow<Q>, 
[src]

Removes a key from the map, returning the value at the key if the key was previously in the map.

The key may be any borrowed form of the map's key type, but the ordering on the borrowed form must match the ordering on the key type.

pub fn entry<S>(&mut self, key: S) -> Entry where
    S: Into<String>, 
[src]

Gets the given key's corresponding entry in the map for in-place manipulation.

pub fn len(&self) -> usize[src]

Returns the number of elements in the map.

pub fn is_empty(&self) -> bool[src]

Returns true if the map contains no elements.

pub fn iter(&self) -> Iter[src]

Gets an iterator over the entries of the map.

pub fn iter_mut(&mut self) -> IterMut[src]

Gets a mutable iterator over the entries of the map.

pub fn keys(&self) -> Keys[src]

Gets an iterator over the keys of the map.

pub fn values(&self) -> Values[src]

Gets an iterator over the values of the map.

pub fn values_mut(&mut self) -> ValuesMut[src]

Gets an iterator over mutable values of the map.

Trait Implementations

impl PartialEq<Context> for Context[src]

impl Clone for Context[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<Value> for Context[src]

impl<'_> From<&'_ Value> for Context[src]

impl From<Map<String, Value>> for Context[src]

impl<'_> From<&'_ Map<String, Value>> for Context[src]

impl<'_> From<&'_ Context> for Context[src]

impl DerefMut for Context[src]

impl Deref for Context[src]

type Target = Map<String, Value>

The resulting type after dereferencing.

impl Debug for Context[src]

Auto Trait Implementations

impl Send for Context

impl Sync for Context

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.