DefaultFeatures

Trait DefaultFeatures 

Source
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§

Source

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.

Source

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>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, T: DefaultFeatures<'a>> SharedFrom<T> for Box<dyn DefaultFeatures<'a> + 'a>

Source§

fn shared_from(t: T) -> Self

Converts the given T to Self.
Source§

impl<'a, S: 'a + ?Sized, T> TwoStepShared<T, S> for Box<dyn DefaultFeatures<'a> + 'a>
where T: SafeBorrow<S> + 'a, TwoStepArc<T, S>: DefaultFeatures<'a>,

Source§

fn new_two_step() -> Self

Returns a new, empty instance of Self.
Source§

unsafe fn deref_holder(&mut self) -> &mut Option<T>

Returns the internal Option<T> backing this value. Read more

Implementors§

Source§

impl<'a, T: 'a + Send + Sync + Clone + Sized> DefaultFeatures<'a> for T