Trait Take
pub trait Take: Sized {
// Required method
fn dummy() -> Self;
// Provided methods
fn take(&mut self) -> Self { ... }
fn map_with_mut<F>(&mut self, op: F)
where F: FnOnce(Self) -> Self { ... }
}Available on crate features
__ecma and __utils only.Expand description
Helper for people who are working on VisitMut.
This trait is implemented for ast nodes. If not and you need it, please file an issue.
Required Methods§
fn dummy() -> Self
fn dummy() -> Self
Create a dummy value of this type.
Provided Methods§
fn take(&mut self) -> Self
fn map_with_mut<F>(&mut self, op: F)where
F: FnOnce(Self) -> Self,
fn map_with_mut<F>(&mut self, op: F)where
F: FnOnce(Self) -> Self,
Mutate self using op, which accepts owned data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.