Struct rd_interface::Context [−][src]
A context stores a source endpoint, a process info and other any values during connecting.
Implementations
impl Context
[src]
pub fn new() -> Context
[src]
new a empty context
pub fn insert<I: Serialize>(
&mut self,
key: String,
value: I
) -> Result<(), Error>
[src]
&mut self,
key: String,
value: I
) -> Result<(), Error>
Inserts a key-value pair into the context.
pub fn remove<T: DeserializeOwned>(&mut self, key: &str) -> Result<T, Error>
[src]
Removes a key from the context, returning the value at the key if the key was previously in the context.
pub fn get<T: DeserializeOwned>(&self, key: &str) -> Result<T, Error>
[src]
Returns a value corresponding to the key.
pub fn insert_value(&mut self, key: String, value: Value)
[src]
Inserts a key-value pair into the context.
pub fn remove_value(&mut self, key: &str) -> Option<Value>
[src]
Removes a key from the context, returning the value at the key if the key was previously in the context.
pub fn get_value(&self, key: &str) -> Option<&Value>
[src]
Returns a value corresponding to the key.
pub fn insert_common<T: CommonField>(
&mut self,
value: T::Type
) -> Result<(), Error>
[src]
&mut self,
value: T::Type
) -> Result<(), Error>
Inserts a key-value pair into the context.
pub fn get_common<T: CommonField>(&self) -> Result<T::Type, Error>
[src]
Returns a value corresponding to the key.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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>,