pub struct Scope<'scope, 'a, A, T> { /* private fields */ }
Expand description
passed in scope type it not use the context to pass data, but keep it’s own data ref this struct provide both compile type info and runtime data
Implementations§
source§impl<'scope, 'a, A, T> Scope<'scope, 'a, A, T>
impl<'scope, 'a, A, T> Scope<'scope, 'a, A, T>
sourcepub fn yield_with(&mut self, v: T)
pub fn yield_with(&mut self, v: T)
yield something without catch passed in para
sourcepub unsafe fn yield_unsafe(&mut self, v: T) -> Option<A>
pub unsafe fn yield_unsafe(&mut self, v: T) -> Option<A>
yield and get the send para
§Safety
When yield out, the reference of the captured data must be still valid
normally, you should always call the drop
of the generator
sourcepub unsafe fn yield_from_unsafe(&mut self, g: Generator<'_, A, T>) -> Option<A>
pub unsafe fn yield_from_unsafe(&mut self, g: Generator<'_, A, T>) -> Option<A>
yield_from_unsafe
the from generator must has the same type as itself
§Safety
When yield out, the reference of the captured data must be still valid
normally, you should always call the drop
of the generator
Auto Trait Implementations§
impl<'scope, 'a, A, T> Freeze for Scope<'scope, 'a, A, T>
impl<'scope, 'a, A, T> RefUnwindSafe for Scope<'scope, 'a, A, T>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<'scope, 'a, A, T> Send for Scope<'scope, 'a, A, T>
impl<'scope, 'a, A, T> Sync for Scope<'scope, 'a, A, T>
impl<'scope, 'a, A, T> Unpin for Scope<'scope, 'a, A, T>
impl<'scope, 'a, A, T> !UnwindSafe for Scope<'scope, 'a, A, T>
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