Struct escher::Escher [−][src]
A containter of a self referencial struct. The self-referencial struct is constructed with the aid of the async/await machinery of rustc, see Escher::new.
Implementations
impl<'fut, T: Rebindable> Escher<'fut, T>
[src]
pub fn new<B, F>(builder: B) -> Self where
B: FnOnce(Capturer<T>) -> F,
F: Future<Output = ()> + 'fut,
[src]
B: FnOnce(Capturer<T>) -> F,
F: Future<Output = ()> + 'fut,
Construct a self referencial struct using the provided closure. The user is expected to construct the desired data and references to them in the async stack and capture the desired state when ready.
use escher::Escher; let escher_heart = Escher::new(|r| async move { let data: Vec<u8> = vec![240, 159, 146, 150]; let sparkle_heart = std::str::from_utf8(&data).unwrap(); r.capture(sparkle_heart).await; }); assert_eq!("💖", *escher_heart.as_ref());
pub fn as_ref<'a>(&'a self) -> &Rebind<'a, T>
[src]
Get a shared reference to the inner T
with its lifetime bound to &self
pub fn as_mut<'a>(&'a mut self) -> &mut Rebind<'a, T>
[src]
Get a mut reference to the inner T
with its lifetime bound to &mut self
Auto Trait Implementations
impl<'fut, T> !RefUnwindSafe for Escher<'fut, T>
impl<'fut, T> !Send for Escher<'fut, T>
impl<'fut, T> !Sync for Escher<'fut, T>
impl<'fut, T> Unpin for Escher<'fut, T>
impl<'fut, T> !UnwindSafe for Escher<'fut, T>
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>,