pub struct Export { /* private fields */ }
Expand description
Abstraction for the result of local computation. It is an AST decorated with the computation value.
Implementations§
source§impl Export
impl Export
sourcepub fn put<A: 'static, F>(&mut self, path: Path, value: F) -> Awhere
F: Fn() -> A,
pub fn put<A: 'static, F>(&mut self, path: Path, value: F) -> Awhere
F: Fn() -> A,
Inserts a value in the Export at the given Path.
Arguments
path
- The Path where to insert the value.value
- The value to insert.
Generic Parameters
A
- The type of the value to insert. It must have a'static
lifetime.F
- The type of the function to insert.
Returns
The inserted value.
sourcepub fn get<A: 'static + FromStr + Clone>(&self, path: &Path) -> Result<A>
pub fn get<A: 'static + FromStr + Clone>(&self, path: &Path) -> Result<A>
Returns the value at the given Path.
Arguments
path
- The Path where to get the value.
Generic Parameters
A
- The type of the value to get to return. It must have a'static
lifetime.
Returns
The value at the given Path.
sourcepub fn root<A: 'static + FromStr + Clone>(&self) -> A
pub fn root<A: 'static + FromStr + Clone>(&self) -> A
Obtain the root value.
Generic Parameters
A
- The type of the value to return. It must have a'static
lifetime.
Returns
The root value.
Panics
- Panics if there is not a root value (a value at the empty Path).
- Panics if the type of the root value is not the same as the type of the requested value.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Export
impl<'de> Deserialize<'de> for Export
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Export
impl !Send for Export
impl !Sync for Export
impl Unpin for Export
impl !UnwindSafe for Export
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