BorrowMut

Trait BorrowMut 

1.36.0 (const: unstable) · Source
pub trait BorrowMut<Borrowed>: Borrow<Borrowed>
where Borrowed: ?Sized,
{ // Required method fn borrow_mut(&mut self) -> &mut Borrowed; }
Expand description

A trait for mutably borrowing data.

As a companion to Borrow<T> this trait allows a type to borrow as an underlying type by providing a mutable reference. See Borrow<T> for more information on borrowing as another type.

Required Methods§

1.0.0 · Source

fn borrow_mut(&mut self) -> &mut Borrowed

Mutably borrows from an owned value.

§Examples
use std::borrow::BorrowMut;

fn check<T: BorrowMut<[i32]>>(mut v: T) {
    assert_eq!(&mut [1, 2, 3], v.borrow_mut());
}

let v = vec![1, 2, 3];

check(v);

Implementors§

1.36.0 · Source§

impl BorrowMut<str> for String

§

impl BorrowMut<Asn1BitStringRef> for Asn1BitString

§

impl BorrowMut<Asn1GeneralizedTimeRef> for Asn1GeneralizedTime

§

impl BorrowMut<Asn1IntegerRef> for Asn1Integer

§

impl BorrowMut<Asn1ObjectRef> for Asn1Object

§

impl BorrowMut<Asn1StringRef> for Asn1String

§

impl BorrowMut<Asn1TimeRef> for Asn1Time

§

impl BorrowMut<BigNumContextRef> for BigNumContext

§

impl BorrowMut<BigNumRef> for BigNum

§

impl BorrowMut<ConfRef> for Conf

§

impl BorrowMut<EcGroupRef> for EcGroup

§

impl BorrowMut<EcPointRef> for EcPoint

§

impl BorrowMut<EcdsaSigRef> for EcdsaSig

§

impl BorrowMut<HmacCtxRef> for HmacCtx

§

impl BorrowMut<HpkeKeyRef> for HpkeKey

§

impl BorrowMut<Pkcs12Ref> for Pkcs12

§

impl BorrowMut<SrtpProtectionProfileRef> for SrtpProtectionProfile

§

impl BorrowMut<SslContextRef> for SslContext

§

impl BorrowMut<SslEchKeysRef> for SslEchKeys

§

impl BorrowMut<SslRef> for Ssl

§

impl BorrowMut<SslSessionRef> for SslSession

§

impl BorrowMut<OpensslStringRef> for OpensslString

§

impl BorrowMut<CipherCtxRef> for CipherCtx

§

impl BorrowMut<X509StoreBuilderRef> for X509StoreBuilder

§

impl BorrowMut<X509StoreRef> for X509Store

§

impl BorrowMut<GeneralNameRef> for GeneralName

§

impl BorrowMut<X509AlgorithmRef> for X509Algorithm

§

impl BorrowMut<X509ExtensionRef> for X509Extension

§

impl BorrowMut<X509NameEntryRef> for X509NameEntry

§

impl BorrowMut<X509NameRef> for X509Name

§

impl BorrowMut<X509ObjectRef> for X509Object

§

impl BorrowMut<X509Ref> for X509

§

impl BorrowMut<X509ReqRef> for X509Req

§

impl BorrowMut<X509StoreContextRef> for X509StoreContext

§

impl BorrowMut<X509VerifyParamRef> for X509VerifyParam

Source§

impl BorrowMut<ByteStr> for ByteString

§

impl BorrowMut<[u8]> for BytesMut

Source§

impl BorrowMut<[u8]> for ByteStr

Source§

impl BorrowMut<[u8]> for ByteString

§

impl<'s, T> BorrowMut<[T]> for SliceVec<'s, T>

§

impl<A> BorrowMut<[<A as Array>::Item]> for SmallVec<A>
where A: Array,

§

impl<A> BorrowMut<[<A as Array>::Item]> for ArrayVec<A>
where A: Array,

§

impl<A> BorrowMut<[<A as Array>::Item]> for TinyVec<A>
where A: Array,

1.0.0 (const: unstable) · Source§

impl<T> BorrowMut<T> for &mut T
where T: ?Sized,

§

impl<T> BorrowMut<T> for Owned<T>
where T: Pointable + ?Sized,

1.0.0 (const: unstable) · Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

1.0.0 · Source§

impl<T, A> BorrowMut<[T]> for Vec<T, A>
where A: Allocator,

1.1.0 · Source§

impl<T, A> BorrowMut<T> for rama::utils::collections::smallvec::alloc::boxed::Box<T, A>
where A: Allocator, T: ?Sized,

Source§

impl<T, A> BorrowMut<T> for UniqueRc<T, A>
where A: Allocator, T: ?Sized,

Source§

impl<T, A> BorrowMut<T> for UniqueArc<T, A>
where A: Allocator, T: ?Sized,

§

impl<T, A> BorrowMut<T> for Box<T, A>
where A: Allocator, T: ?Sized,

§

impl<T, N> BorrowMut<[T]> for GenericArray<T, N>
where N: ArrayLength<T>,

1.4.0 (const: unstable) · Source§

impl<T, const N: usize> BorrowMut<[T]> for [T; N]