pub struct CaptureSet { /* private fields */ }Expand description
A set of variable names captured by a closure.
Implementations§
Source§impl CaptureSet
impl CaptureSet
Sourcepub fn is_captured(&self, name: &str) -> bool
pub fn is_captured(&self, name: &str) -> bool
Whether a variable is captured.
Sourcepub fn iter(&self) -> impl Iterator<Item = &str>
pub fn iter(&self) -> impl Iterator<Item = &str>
Iterate over captured variable names in sorted order.
Sourcepub fn union(&mut self, other: &CaptureSet)
pub fn union(&mut self, other: &CaptureSet)
Union with another capture set.
Sourcepub fn difference(&mut self, other: &CaptureSet)
pub fn difference(&mut self, other: &CaptureSet)
Difference: remove all variables in other from self.
Trait Implementations§
Source§impl Clone for CaptureSet
impl Clone for CaptureSet
Source§fn clone(&self) -> CaptureSet
fn clone(&self) -> CaptureSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CaptureSet
impl Debug for CaptureSet
Source§impl Default for CaptureSet
impl Default for CaptureSet
Source§fn default() -> CaptureSet
fn default() -> CaptureSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CaptureSet
impl RefUnwindSafe for CaptureSet
impl Send for CaptureSet
impl Sync for CaptureSet
impl Unpin for CaptureSet
impl UnsafeUnpin for CaptureSet
impl UnwindSafe for CaptureSet
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