Module gazebo::prelude [−][src]
Expand description
Standard functions. Usually imported with use gazebo::prelude::*
.
Contains:
- Extension methods for
str
and slice/Vec
. - Exports the
Dupe
trait. - Defines derive macros such as
Dupe_
.
The derivation macros appended with underscore are like the normal derivations, but don’t require the trait on any argument types. For example, given the type:
#[derive(Clone_)]
struct Foo<T>(Arc<T>);
It is possible to use derive(Clone)
, but that would require that
T
implements Clone
, which is unnecessary. Using
Clone_
removes that constraint.
Re-exports
pub use crate::dupe::Dupe;
Traits
Extension traits on Option
where it holds a ref.
Short hand analogous to Iter::cloned
, where items of &T
are converted to T
via clone.
Short hand analogous to Iter::copied
, where items of &T
are converted to T
via copy
.
Short hand analogous to Iter::duped
, where items of &T
are converted to T
via dupe
.
Derive Macros
Derive the Clone
trait, but without requiring all type arguments to implement Clone
.
Derive the Copy
trait, but without requiring all type arguments to implement Copy
.
Derive the Default
trait, but without requiring all type arguments to implement Default
.
Derive the Dupe
trait.
Derive the Dupe
trait, but without requiring all type arguments to implement Dupe
.