Downgrade

Trait Downgrade 

Source
pub trait Downgrade<R> {
    // Required methods
    fn downgrade(input: &Self) -> &R;
    fn downgrade_mut(input: &mut Self) -> &mut R;
}
Expand description

Methods (downgrade) for downgrading (partial) references.

Reborrows a partial or complete (ordinary) struct borrow as a partial borrow, possibly imposing further restrictions (as defined by the return type R).

Note that these associated functions are not methods, to avoid interfering with any methods on Self. If you want a method, use the AsRef or AsMut implementations, which are also provided whenever this trait is.

This trait will be derived. You probably don’t want to implement it.

Required Methods§

Source

fn downgrade(input: &Self) -> &R

Source

fn downgrade_mut(input: &mut Self) -> &mut R

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.

Implementors§