Trait gclient::ext::sp_core::sp_std::convert::AsMut

1.0.0 · source ·
pub trait AsMut<T>
where T: ?Sized,
{ // Required method fn as_mut(&mut self) -> &mut T; }
Expand description

Used to do a cheap mutable-to-mutable reference conversion.

This trait is similar to AsRef but used for converting between mutable references. If you need to do a costly conversion it is better to implement From with type &mut T or write a custom function.

Note: This trait must not fail. If the conversion can fail, use a dedicated method which returns an Option<T> or a Result<T, E>.

§Generic Implementations

AsMut auto-dereferences if the inner type is a mutable reference (e.g.: foo.as_mut() will work the same if foo has type &mut Foo or &mut &mut Foo).

Note that due to historic reasons, the above currently does not hold generally for all mutably dereferenceable types, e.g. foo.as_mut() will not work the same as Box::new(foo).as_mut(). Instead, many smart pointers provide an as_mut implementation which simply returns a reference to the pointed-to value (but do not perform a cheap reference-to-reference conversion for that value). However, AsMut::as_mut should not be used for the sole purpose of mutable dereferencing; instead Deref coercion’ can be used:

let mut x = Box::new(5i32);
// Avoid this:
// let y: &mut i32 = x.as_mut();
// Better just write:
let y: &mut i32 = &mut x;

Types which implement DerefMut should consider to add an implementation of AsMut<T> as follows:

impl<T> AsMut<T> for SomeType
where
    <SomeType as Deref>::Target: AsMut<T>,
{
    fn as_mut(&mut self) -> &mut T {
        self.deref_mut().as_mut()
    }
}

§Reflexivity

Ideally, AsMut would be reflexive, i.e. there would be an impl<T: ?Sized> AsMut<T> for T with as_mut simply returning its argument unchanged. Such a blanket implementation is currently not provided due to technical restrictions of Rust’s type system (it would be overlapping with another existing blanket implementation for &mut T where T: AsMut<U> which allows AsMut to auto-dereference, see “Generic Implementations” above).

A trivial implementation of AsMut<T> for T must be added explicitly for a particular type T where needed or desired. Note, however, that not all types from std contain such an implementation, and those cannot be added by external code due to orphan rules.

§Examples

Using AsMut as trait bound for a generic function, we can accept all mutable references that can be converted to type &mut T. Unlike dereference, which has a single target type, there can be multiple implementations of AsMut for a type. In particular, Vec<T> implements both AsMut<Vec<T>> and AsMut<[T]>.

In the following, the example functions caesar and null_terminate provide a generic interface which work with any type that can be converted by cheap mutable-to-mutable conversion into a byte slice ([u8]) or byte vector (Vec<u8>), respectively.

struct Document {
    info: String,
    content: Vec<u8>,
}

impl<T: ?Sized> AsMut<T> for Document
where
    Vec<u8>: AsMut<T>,
{
    fn as_mut(&mut self) -> &mut T {
        self.content.as_mut()
    }
}

fn caesar<T: AsMut<[u8]>>(data: &mut T, key: u8) {
    for byte in data.as_mut() {
        *byte = byte.wrapping_add(key);
    }
}

fn null_terminate<T: AsMut<Vec<u8>>>(data: &mut T) {
    // Using a non-generic inner function, which contains most of the
    // functionality, helps to minimize monomorphization overhead.
    fn doit(data: &mut Vec<u8>) {
        let len = data.len();
        if len == 0 || data[len-1] != 0 {
            data.push(0);
        }
    }
    doit(data.as_mut());
}

fn main() {
    let mut v: Vec<u8> = vec![1, 2, 3];
    caesar(&mut v, 5);
    assert_eq!(v, [6, 7, 8]);
    null_terminate(&mut v);
    assert_eq!(v, [6, 7, 8, 0]);
    let mut doc = Document {
        info: String::from("Example"),
        content: vec![17, 19, 8],
    };
    caesar(&mut doc, 1);
    assert_eq!(doc.content, [18, 20, 9]);
    null_terminate(&mut doc);
    assert_eq!(doc.content, [18, 20, 9, 0]);
}

Note, however, that APIs don’t need to be generic. In many cases taking a &mut [u8] or &mut Vec<u8>, for example, is the better choice (callers need to pass the correct type then).

Required Methods§

1.0.0 · source

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.

Implementors§

1.51.0 · source§

impl AsMut<str> for str

1.43.0 · source§

impl AsMut<str> for String

§

impl AsMut<Pair> for gclient::ext::sp_runtime::app_crypto::ecdsa::AppPair

§

impl AsMut<Public> for gclient::ext::sp_runtime::app_crypto::ecdsa::AppPublic

§

impl AsMut<Signature> for gclient::ext::sp_runtime::app_crypto::ecdsa::AppSignature

§

impl AsMut<Pair> for gclient::ext::sp_runtime::app_crypto::ed25519::AppPair

§

impl AsMut<Public> for gclient::ext::sp_runtime::app_crypto::ed25519::AppPublic

§

impl AsMut<Signature> for gclient::ext::sp_runtime::app_crypto::ed25519::AppSignature

§

impl AsMut<Pair> for gclient::ext::sp_runtime::app_crypto::sr25519::AppPair

§

impl AsMut<Public> for gclient::ext::sp_runtime::app_crypto::sr25519::AppPublic

§

impl AsMut<Signature> for gclient::ext::sp_runtime::app_crypto::sr25519::AppSignature

§

impl AsMut<BStr> for BString

§

impl AsMut<BStr> for [u8]

§

impl AsMut<Interval> for IntervalStream

§

impl AsMut<[u8; 32]> for AccountId32

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ecdsa::AppPublic

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ecdsa::Public

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ecdsa::Signature

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ed25519::AppPublic

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ed25519::Public

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::ed25519::Signature

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::sr25519::AppPublic

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::sr25519::Public

§

impl AsMut<[u8]> for gclient::ext::sp_runtime::app_crypto::sr25519::Signature

§

impl AsMut<[u8]> for AccountId32

§

impl AsMut<[u8]> for H256

§

impl AsMut<[u8]> for Dummy

§

impl AsMut<[u8]> for H160

§

impl AsMut<[u8]> for H512

§

impl AsMut<[u8]> for BStr

§

impl AsMut<[u8]> for BString

§

impl AsMut<[u8]> for BytesMut

§

impl AsMut<[u8]> for H128

§

impl AsMut<[u8]> for H384

§

impl AsMut<[u8]> for H768

§

impl AsMut<[u8]> for SignatureArray

§

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

source§

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

§

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

§

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

§

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

§

impl<A, O> AsMut<BitSlice<<A as BitView>::Store, O>> for BitArray<A, O>
where A: BitViewSized, O: BitOrder,

source§

impl<L, R> AsMut<str> for Either<L, R>
where L: AsMut<str>, R: AsMut<str>,

source§

impl<L, R> AsMut<CStr> for Either<L, R>
where L: AsMut<CStr>, R: AsMut<CStr>,

Requires crate feature use_std.

source§

impl<L, R> AsMut<OsStr> for Either<L, R>
where L: AsMut<OsStr>, R: AsMut<OsStr>,

Requires crate feature use_std.

source§

impl<L, R> AsMut<Path> for Either<L, R>
where L: AsMut<Path>, R: AsMut<Path>,

Requires crate feature use_std.

source§

impl<L, R, Target> AsMut<[Target]> for Either<L, R>
where L: AsMut<[Target]>, R: AsMut<[Target]>,

source§

impl<L, R, Target> AsMut<Target> for Either<L, R>
where L: AsMut<Target>, R: AsMut<Target>,

§

impl<T> AsMut<[T; 1]> for GenericArray<T, UInt<UTerm, B1>>

§

impl<T> AsMut<[T; 2]> for GenericArray<T, UInt<UInt<UTerm, B1>, B0>>

§

impl<T> AsMut<[T; 3]> for GenericArray<T, UInt<UInt<UTerm, B1>, B1>>

§

impl<T> AsMut<[T; 4]> for GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 5]> for GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 6]> for GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 7]> for GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 8]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 9]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 10]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 11]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 12]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 13]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 14]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 15]> for GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 16]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 17]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 18]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 19]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 20]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 21]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 22]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 23]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 24]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 25]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 26]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 27]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 28]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 29]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 30]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 31]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 32]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 33]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 34]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 35]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 36]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 37]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 38]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 39]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 40]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 41]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 42]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 43]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 44]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 45]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 46]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 47]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 48]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 49]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 50]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 51]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 52]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 53]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 54]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 55]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 56]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 57]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>>

§

impl<T> AsMut<[T; 58]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 59]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B1>>

§

impl<T> AsMut<[T; 60]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 61]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B1>>

§

impl<T> AsMut<[T; 62]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 63]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>>

§

impl<T> AsMut<[T; 64]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 70]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>, B0>>

§

impl<T> AsMut<[T; 80]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 90]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>, B0>>

§

impl<T> AsMut<[T; 100]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 128]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 200]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 256]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 300]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 400]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 500]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>>

§

impl<T> AsMut<[T; 512]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 1000]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>, B0>>

§

impl<T> AsMut<[T; 1024]> for GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>

1.0.0 · source§

impl<T> AsMut<[T]> for [T]

§

impl<T> AsMut<Receiver<T>> for ReceiverStream<T>

§

impl<T> AsMut<T> for FmtBinary<T>
where T: Binary,

§

impl<T> AsMut<T> for FmtDisplay<T>
where T: Display,

§

impl<T> AsMut<T> for FmtList<T>
where &'a T: for<'a> IntoIterator,

§

impl<T> AsMut<T> for FmtLowerExp<T>
where T: LowerExp,

§

impl<T> AsMut<T> for FmtLowerHex<T>
where T: LowerHex,

§

impl<T> AsMut<T> for FmtOctal<T>
where T: Octal,

§

impl<T> AsMut<T> for FmtPointer<T>
where T: Pointer,

§

impl<T> AsMut<T> for FmtUpperExp<T>
where T: UpperExp,

§

impl<T> AsMut<T> for FmtUpperHex<T>
where T: UpperHex,

§

impl<T> AsMut<UnboundedReceiver<T>> for UnboundedReceiverStream<T>

§

impl<T> AsMut<[u8]> for Window<T>
where T: AsMut<[u8]>,

1.5.0 · source§

impl<T, A> AsMut<[T]> for gclient::ext::sp_runtime::app_crypto::Vec<T, A>
where A: Allocator,

§

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

1.5.0 · source§

impl<T, A> AsMut<Vec<T, A>> for gclient::ext::sp_runtime::app_crypto::Vec<T, A>
where A: Allocator,

1.5.0 · source§

impl<T, A> AsMut<T> for gclient::ext::sp_core::sp_std::prelude::Box<T, A>
where A: Allocator, T: ?Sized,

§

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

§

impl<T, A> AsMut<Vec<T, A>> for Vec<T, A>
where A: Allocator,

§

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

§

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

§

impl<T, O> AsMut<bool> for BitRef<'_, Mut, T, O>
where T: BitStore, O: BitOrder,

§

impl<T, O> AsMut<BitSlice<T, O>> for BitBox<T, O>
where T: BitStore, O: BitOrder,

§

impl<T, O> AsMut<BitSlice<T, O>> for BitSlice<T, O>
where T: BitStore, O: BitOrder,

§

impl<T, O> AsMut<BitSlice<T, O>> for BitVec<T, O>
where T: BitStore, O: BitOrder,

§

impl<T, O> AsMut<BitVec<T, O>> for BitVec<T, O>
where T: BitStore, O: BitOrder,

§

impl<T, S> AsMut<[T]> for BoundedVec<T, S>

§

impl<T, S> AsMut<[T]> for WeakBoundedVec<T, S>

1.0.0 · source§

impl<T, U> AsMut<U> for &mut T
where T: AsMut<U> + ?Sized, U: ?Sized,

§

impl<T, Z> AsMut<T> for Zeroizing<Z>
where Z: AsMut<T> + Zeroize, T: ?Sized,

source§

impl<T, const CAP: usize> AsMut<[T]> for arrayvec::arrayvec::ArrayVec<T, CAP>

source§

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

1.0.0 · source§

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

source§

impl<T, const N: usize> AsMut<[T]> for Simd<T, N>

§

impl<__AsMutT> AsMut<__AsMutT> for ActorId
where [u8; 32]: AsMut<__AsMutT>, __AsMutT: ?Sized,

§

impl<__AsMutT> AsMut<__AsMutT> for CodeId
where [u8; 32]: AsMut<__AsMutT>, __AsMutT: ?Sized,

§

impl<__AsMutT> AsMut<__AsMutT> for MessageId
where [u8; 32]: AsMut<__AsMutT>, __AsMutT: ?Sized,

§

impl<__AsMutT> AsMut<__AsMutT> for ReservationId
where [u8; 32]: AsMut<__AsMutT>, __AsMutT: ?Sized,

§

impl<const LEFT_PLUS_RIGHT_LEN: usize> AsMut<[u8]> for gclient::ext::sp_core::paired_crypto::Public<LEFT_PLUS_RIGHT_LEN>

§

impl<const LEFT_PLUS_RIGHT_LEN: usize> AsMut<[u8]> for gclient::ext::sp_core::paired_crypto::Signature<LEFT_PLUS_RIGHT_LEN>