pub trait DefaultFeatures<'a>:
Send
+ Sync
+ 'a {
// Required methods
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>;
fn self_address_mut(&mut self) -> *mut ();
}Expand description
The default shared reference type for Supercow.
This requires the shared reference type to be Clone, Send, and
Sync, which thus disqualifies using Rc. This was chosen as the
default since the inability to use Rc is generally a less subtle
issue than the Supercow not being Send or Sync.
See also NonSyncFeatures.
Required Methods§
Sourcefn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
Clone this value, and then immediately put it into a Box
behind a trait object of this trait.
Sourcefn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of self.
This is used to disassemble trait objects of this trait without
resorting to transmuting or the unstable TraitObject type.
Trait Implementations§
Source§impl<'a> Clone for Box<dyn DefaultFeatures<'a> + 'a>
impl<'a> Clone for Box<dyn DefaultFeatures<'a> + 'a>
Converts the given
T to Self.Source§fn new_two_step() -> Self
fn new_two_step() -> Self
Returns a new, empty instance of
Self.Source§unsafe fn deref_holder(&mut self) -> &mut Option<T>
unsafe fn deref_holder(&mut self) -> &mut Option<T>
Returns the internal
Option<T> backing this value. Read more