devela::_core::prelude::rust_2015

Trait AsRef

1.55.0 · Source
pub trait AsRef<T>
where T: ?Sized,
{ // Required method fn as_ref(&self) -> &T; }
Expand description

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

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

§Relation to Borrow

AsRef has the same signature as Borrow, but Borrow is different in a few aspects:

  • Unlike AsRef, Borrow has a blanket impl for any T, and can be used to accept either a reference or a value. (See also note on AsRef’s reflexibility below.)
  • Borrow also requires that Hash, Eq and Ord for a borrowed value are equivalent to those of the owned value. For this reason, if you want to borrow only a single field of a struct you can implement AsRef, but not Borrow.

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

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

Note that due to historic reasons, the above currently does not hold generally for all dereferenceable types, e.g. foo.as_ref() will not work the same as Box::new(foo).as_ref(). Instead, many smart pointers provide an as_ref 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, AsRef::as_ref should not be used for the sole purpose of dereferencing; instead Deref coercion’ can be used:

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

Types which implement Deref should consider implementing AsRef<T> as follows:

impl<T> AsRef<T> for SomeType
where
    T: ?Sized,
    <SomeType as Deref>::Target: AsRef<T>,
{
    fn as_ref(&self) -> &T {
        self.deref().as_ref()
    }
}

§Reflexivity

Ideally, AsRef would be reflexive, i.e. there would be an impl<T: ?Sized> AsRef<T> for T with as_ref 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 &T where T: AsRef<U> which allows AsRef to auto-dereference, see “Generic Implementations” above).

A trivial implementation of AsRef<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

By using trait bounds we can accept arguments of different types as long as they can be converted to the specified type T.

For example: By creating a generic function that takes an AsRef<str> we express that we want to accept all references that can be converted to &str as an argument. Since both String and &str implement AsRef<str> we can accept both as input argument.

fn is_hello<T: AsRef<str>>(s: T) {
   assert_eq!("hello", s.as_ref());
}

let s = "hello";
is_hello(s);

let s = "hello".to_string();
is_hello(s);

Required Methods§

1.0.0 · Source

fn as_ref(&self) -> &T

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

Implementors§

1.0.0 · Source§

impl AsRef<str> for str

§

impl AsRef<str> for PyBackedStr

§

impl AsRef<str> for ArchivedString

§

impl AsRef<str> for Field

1.0.0 · Source§

impl AsRef<str> for devela::all::String

§

impl AsRef<ContentStyle> for ContentStyle

Source§

impl AsRef<Collator> for Collator

Source§

impl AsRef<DateTimeFormat> for DateTimeFormat

Source§

impl AsRef<NumberFormat> for NumberFormat

Source§

impl AsRef<PluralRules> for PluralRules

Source§

impl AsRef<RelativeTimeFormat> for RelativeTimeFormat

Source§

impl AsRef<CompileError> for CompileError

Source§

impl AsRef<Exception> for Exception

Source§

impl AsRef<Global> for Global

Source§

impl AsRef<Instance> for Instance

Source§

impl AsRef<LinkError> for LinkError

Source§

impl AsRef<Memory> for Memory

Source§

impl AsRef<Module> for Module

Source§

impl AsRef<RuntimeError> for RuntimeError

Source§

impl AsRef<Table> for Table

Source§

impl AsRef<Tag> for Tag

Source§

impl AsRef<Array> for devela::_dep::js_sys::Array

Source§

impl AsRef<ArrayBuffer> for ArrayBuffer

Source§

impl AsRef<AsyncIterator> for AsyncIterator

Source§

impl AsRef<BigInt64Array> for BigInt64Array

Source§

impl AsRef<BigInt> for BigInt

Source§

impl AsRef<BigUint64Array> for BigUint64Array

Source§

impl AsRef<Boolean> for Boolean

Source§

impl AsRef<DataView> for DataView

Source§

impl AsRef<Date> for Date

Source§

impl AsRef<Error> for CompileError

Source§

impl AsRef<Error> for LinkError

Source§

impl AsRef<Error> for RuntimeError

Source§

impl AsRef<Error> for Error

Source§

impl AsRef<Error> for EvalError

Source§

impl AsRef<Error> for RangeError

Source§

impl AsRef<Error> for ReferenceError

Source§

impl AsRef<Error> for SyntaxError

Source§

impl AsRef<Error> for TypeError

Source§

impl AsRef<Error> for UriError

Source§

impl AsRef<EvalError> for EvalError

Source§

impl AsRef<Float32Array> for Float32Array

Source§

impl AsRef<Float64Array> for Float64Array

Source§

impl AsRef<Function> for Function

Source§

impl AsRef<Generator> for Generator

Source§

impl AsRef<Int8Array> for Int8Array

Source§

impl AsRef<Int16Array> for Int16Array

Source§

impl AsRef<Int32Array> for Int32Array

Source§

impl AsRef<Iterator> for Iterator

Source§

impl AsRef<IteratorNext> for IteratorNext

Source§

impl AsRef<JsString> for JsString

Source§

impl AsRef<Map> for Map

Source§

impl AsRef<Number> for Number

Source§

impl AsRef<Object> for Collator

Source§

impl AsRef<Object> for DateTimeFormat

Source§

impl AsRef<Object> for NumberFormat

Source§

impl AsRef<Object> for PluralRules

Source§

impl AsRef<Object> for RelativeTimeFormat

Source§

impl AsRef<Object> for Exception

Source§

impl AsRef<Object> for Global

Source§

impl AsRef<Object> for Instance

Source§

impl AsRef<Object> for Memory

Source§

impl AsRef<Object> for Module

Source§

impl AsRef<Object> for Table

Source§

impl AsRef<Object> for Tag

Source§

impl AsRef<Object> for devela::_dep::js_sys::Array

Source§

impl AsRef<Object> for ArrayBuffer

Source§

impl AsRef<Object> for BigInt64Array

Source§

impl AsRef<Object> for BigInt

Source§

impl AsRef<Object> for BigUint64Array

Source§

impl AsRef<Object> for Boolean

Source§

impl AsRef<Object> for DataView

Source§

impl AsRef<Object> for Date

Source§

impl AsRef<Object> for Error

Source§

impl AsRef<Object> for EvalError

Source§

impl AsRef<Object> for Float32Array

Source§

impl AsRef<Object> for Float64Array

Source§

impl AsRef<Object> for Function

Source§

impl AsRef<Object> for Generator

Source§

impl AsRef<Object> for Int8Array

Source§

impl AsRef<Object> for Int16Array

Source§

impl AsRef<Object> for Int32Array

Source§

impl AsRef<Object> for IteratorNext

Source§

impl AsRef<Object> for JsString

Source§

impl AsRef<Object> for Map

Source§

impl AsRef<Object> for Number

Source§

impl AsRef<Object> for Object

Source§

impl AsRef<Object> for Promise

Source§

impl AsRef<Object> for RangeError

Source§

impl AsRef<Object> for ReferenceError

Source§

impl AsRef<Object> for RegExp

Source§

impl AsRef<Object> for Set

Source§

impl AsRef<Object> for SharedArrayBuffer

Source§

impl AsRef<Object> for SyntaxError

Source§

impl AsRef<Object> for TypeError

Source§

impl AsRef<Object> for Uint8Array

Source§

impl AsRef<Object> for Uint8ClampedArray

Source§

impl AsRef<Object> for Uint16Array

Source§

impl AsRef<Object> for Uint32Array

Source§

impl AsRef<Object> for UriError

Source§

impl AsRef<Object> for WeakMap

Source§

impl AsRef<Object> for WeakSet

Source§

impl AsRef<Promise> for Promise

Source§

impl AsRef<Proxy> for Proxy

Source§

impl AsRef<RangeError> for RangeError

Source§

impl AsRef<ReferenceError> for ReferenceError

Source§

impl AsRef<RegExp> for RegExp

Source§

impl AsRef<Set> for Set

Source§

impl AsRef<SharedArrayBuffer> for SharedArrayBuffer

Source§

impl AsRef<Symbol> for Symbol

Source§

impl AsRef<SyntaxError> for SyntaxError

Source§

impl AsRef<TypeError> for TypeError

Source§

impl AsRef<Uint8Array> for Uint8Array

Source§

impl AsRef<Uint8ClampedArray> for Uint8ClampedArray

Source§

impl AsRef<Uint16Array> for Uint16Array

Source§

impl AsRef<Uint32Array> for Uint32Array

Source§

impl AsRef<UriError> for UriError

Source§

impl AsRef<WeakMap> for WeakMap

Source§

impl AsRef<WeakSet> for WeakSet

§

impl AsRef<Path> for Cow<'_, OsStr>

§

impl AsRef<Path> for str

§

impl AsRef<Path> for Path

§

impl AsRef<Path> for PathBuf

§

impl AsRef<Path> for devela::all::String

§

impl AsRef<Path> for OsStr

§

impl AsRef<Path> for OsString

§

impl AsRef<PyAny> for CancelledError

§

impl AsRef<PyAny> for IncompleteReadError

§

impl AsRef<PyAny> for InvalidStateError

§

impl AsRef<PyAny> for LimitOverrunError

§

impl AsRef<PyAny> for QueueEmpty

§

impl AsRef<PyAny> for QueueFull

§

impl AsRef<PyAny> for TimeoutError

§

impl AsRef<PyAny> for gaierror

§

impl AsRef<PyAny> for herror

§

impl AsRef<PyAny> for timeout

§

impl AsRef<PyAny> for PyArithmeticError

§

impl AsRef<PyAny> for PyAssertionError

§

impl AsRef<PyAny> for PyAttributeError

§

impl AsRef<PyAny> for PyBaseException

§

impl AsRef<PyAny> for PyBlockingIOError

§

impl AsRef<PyAny> for PyBrokenPipeError

§

impl AsRef<PyAny> for PyBufferError

§

impl AsRef<PyAny> for PyBytesWarning

§

impl AsRef<PyAny> for PyChildProcessError

§

impl AsRef<PyAny> for PyConnectionAbortedError

§

impl AsRef<PyAny> for PyConnectionError

§

impl AsRef<PyAny> for PyConnectionRefusedError

§

impl AsRef<PyAny> for PyConnectionResetError

§

impl AsRef<PyAny> for PyDeprecationWarning

§

impl AsRef<PyAny> for PyEOFError

§

impl AsRef<PyAny> for PyEncodingWarning

§

impl AsRef<PyAny> for PyEnvironmentError

§

impl AsRef<PyAny> for PyException

§

impl AsRef<PyAny> for PyFileExistsError

§

impl AsRef<PyAny> for PyFileNotFoundError

§

impl AsRef<PyAny> for PyFloatingPointError

§

impl AsRef<PyAny> for PyFutureWarning

§

impl AsRef<PyAny> for PyGeneratorExit

§

impl AsRef<PyAny> for PyIOError

§

impl AsRef<PyAny> for PyImportError

§

impl AsRef<PyAny> for PyImportWarning

§

impl AsRef<PyAny> for PyIndexError

§

impl AsRef<PyAny> for PyInterruptedError

§

impl AsRef<PyAny> for PyIsADirectoryError

§

impl AsRef<PyAny> for PyKeyError

§

impl AsRef<PyAny> for PyKeyboardInterrupt

§

impl AsRef<PyAny> for PyLookupError

§

impl AsRef<PyAny> for PyMemoryError

§

impl AsRef<PyAny> for PyModuleNotFoundError

§

impl AsRef<PyAny> for PyNameError

§

impl AsRef<PyAny> for PyNotADirectoryError

§

impl AsRef<PyAny> for PyNotImplementedError

§

impl AsRef<PyAny> for PyOSError

§

impl AsRef<PyAny> for PyOverflowError

§

impl AsRef<PyAny> for PyPendingDeprecationWarning

§

impl AsRef<PyAny> for PyPermissionError

§

impl AsRef<PyAny> for PyProcessLookupError

§

impl AsRef<PyAny> for PyRecursionError

§

impl AsRef<PyAny> for PyReferenceError

§

impl AsRef<PyAny> for PyResourceWarning

§

impl AsRef<PyAny> for PyRuntimeError

§

impl AsRef<PyAny> for PyRuntimeWarning

§

impl AsRef<PyAny> for PyStopAsyncIteration

§

impl AsRef<PyAny> for PyStopIteration

§

impl AsRef<PyAny> for PySyntaxError

§

impl AsRef<PyAny> for PySyntaxWarning

§

impl AsRef<PyAny> for PySystemError

§

impl AsRef<PyAny> for PySystemExit

§

impl AsRef<PyAny> for PyTimeoutError

§

impl AsRef<PyAny> for PyTypeError

§

impl AsRef<PyAny> for PyUnboundLocalError

§

impl AsRef<PyAny> for PyUnicodeDecodeError

§

impl AsRef<PyAny> for PyUnicodeEncodeError

§

impl AsRef<PyAny> for PyUnicodeError

§

impl AsRef<PyAny> for PyUnicodeTranslateError

§

impl AsRef<PyAny> for PyUnicodeWarning

§

impl AsRef<PyAny> for PyUserWarning

§

impl AsRef<PyAny> for PyValueError

§

impl AsRef<PyAny> for PyWarning

§

impl AsRef<PyAny> for PyZeroDivisionError

§

impl AsRef<PyAny> for PanicException

§

impl AsRef<PyAny> for PyBool

§

impl AsRef<PyAny> for PyByteArray

§

impl AsRef<PyAny> for PyBytes

§

impl AsRef<PyAny> for PyCFunction

§

impl AsRef<PyAny> for PyCapsule

§

impl AsRef<PyAny> for PyCode

§

impl AsRef<PyAny> for PyComplex

§

impl AsRef<PyAny> for PyDate

§

impl AsRef<PyAny> for PyDateTime

§

impl AsRef<PyAny> for PyDelta

§

impl AsRef<PyAny> for PyDict

§

impl AsRef<PyAny> for PyDictItems

§

impl AsRef<PyAny> for PyDictKeys

§

impl AsRef<PyAny> for PyDictValues

§

impl AsRef<PyAny> for PyEllipsis

§

impl AsRef<PyAny> for PyFloat

§

impl AsRef<PyAny> for PyFrame

§

impl AsRef<PyAny> for PyFrozenSet

§

impl AsRef<PyAny> for PyFunction

§

impl AsRef<PyAny> for PyInt

§

impl AsRef<PyAny> for PyIterator

§

impl AsRef<PyAny> for PyList

§

impl AsRef<PyAny> for PyMapping

§

impl AsRef<PyAny> for PyMappingProxy

§

impl AsRef<PyAny> for PyMemoryView

§

impl AsRef<PyAny> for PyModule

§

impl AsRef<PyAny> for PyNone

§

impl AsRef<PyAny> for PyNotImplemented

§

impl AsRef<PyAny> for PySequence

§

impl AsRef<PyAny> for PySet

§

impl AsRef<PyAny> for PySlice

§

impl AsRef<PyAny> for PyString

§

impl AsRef<PyAny> for PySuper

§

impl AsRef<PyAny> for PyTime

§

impl AsRef<PyAny> for PyTraceback

§

impl AsRef<PyAny> for PyTuple

§

impl AsRef<PyAny> for PyType

§

impl AsRef<PyAny> for PyTzInfo

§

impl AsRef<PyAny> for PyWeakref

§

impl AsRef<PyAny> for PyWeakrefProxy

§

impl AsRef<PyAny> for PyWeakrefReference

Source§

impl AsRef<JsValue> for Collator

Source§

impl AsRef<JsValue> for DateTimeFormat

Source§

impl AsRef<JsValue> for NumberFormat

Source§

impl AsRef<JsValue> for PluralRules

Source§

impl AsRef<JsValue> for RelativeTimeFormat

Source§

impl AsRef<JsValue> for CompileError

Source§

impl AsRef<JsValue> for Exception

Source§

impl AsRef<JsValue> for Global

Source§

impl AsRef<JsValue> for Instance

Source§

impl AsRef<JsValue> for LinkError

Source§

impl AsRef<JsValue> for Memory

Source§

impl AsRef<JsValue> for Module

Source§

impl AsRef<JsValue> for RuntimeError

Source§

impl AsRef<JsValue> for Table

Source§

impl AsRef<JsValue> for Tag

Source§

impl AsRef<JsValue> for devela::_dep::js_sys::Array

Source§

impl AsRef<JsValue> for ArrayBuffer

Source§

impl AsRef<JsValue> for AsyncIterator

Source§

impl AsRef<JsValue> for BigInt64Array

Source§

impl AsRef<JsValue> for BigInt

Source§

impl AsRef<JsValue> for BigUint64Array

Source§

impl AsRef<JsValue> for Boolean

Source§

impl AsRef<JsValue> for DataView

Source§

impl AsRef<JsValue> for Date

Source§

impl AsRef<JsValue> for Error

Source§

impl AsRef<JsValue> for EvalError

Source§

impl AsRef<JsValue> for Float32Array

Source§

impl AsRef<JsValue> for Float64Array

Source§

impl AsRef<JsValue> for Function

Source§

impl AsRef<JsValue> for Generator

Source§

impl AsRef<JsValue> for Int8Array

Source§

impl AsRef<JsValue> for Int16Array

Source§

impl AsRef<JsValue> for Int32Array

Source§

impl AsRef<JsValue> for Iterator

Source§

impl AsRef<JsValue> for IteratorNext

Source§

impl AsRef<JsValue> for JsString

Source§

impl AsRef<JsValue> for Map

Source§

impl AsRef<JsValue> for Number

Source§

impl AsRef<JsValue> for Object

Source§

impl AsRef<JsValue> for Promise

Source§

impl AsRef<JsValue> for Proxy

Source§

impl AsRef<JsValue> for RangeError

Source§

impl AsRef<JsValue> for ReferenceError

Source§

impl AsRef<JsValue> for RegExp

Source§

impl AsRef<JsValue> for Set

Source§

impl AsRef<JsValue> for SharedArrayBuffer

Source§

impl AsRef<JsValue> for Symbol

Source§

impl AsRef<JsValue> for SyntaxError

Source§

impl AsRef<JsValue> for TypeError

Source§

impl AsRef<JsValue> for Uint8Array

Source§

impl AsRef<JsValue> for Uint8ClampedArray

Source§

impl AsRef<JsValue> for Uint16Array

Source§

impl AsRef<JsValue> for Uint32Array

Source§

impl AsRef<JsValue> for UriError

Source§

impl AsRef<JsValue> for WeakMap

Source§

impl AsRef<JsValue> for WeakSet

Source§

impl AsRef<JsValue> for JsValue

§

impl AsRef<BStr> for str

§

impl AsRef<BStr> for [u8]

§

impl AsRef<Bytes> for str

§

impl AsRef<Bytes> for [u8]

1.8.0 · Source§

impl AsRef<Path> for Cow<'_, OsStr>

1.25.0 · Source§

impl AsRef<Path> for Component<'_>

1.0.0 · Source§

impl AsRef<Path> for str

§

impl AsRef<Path> for DecInt

1.0.0 · Source§

impl AsRef<Path> for devela::all::IterPath<'_>

1.0.0 · Source§

impl AsRef<Path> for Components<'_>

1.0.0 · Source§

impl AsRef<Path> for Path

1.0.0 · Source§

impl AsRef<Path> for PathBuf

1.0.0 · Source§

impl AsRef<Path> for devela::all::String

1.0.0 · Source§

impl AsRef<Path> for OsStr

1.0.0 · Source§

impl AsRef<Path> for OsString

§

impl AsRef<CStr> for ArchivedCString

1.7.0 · Source§

impl AsRef<CStr> for CStr

1.7.0 · Source§

impl AsRef<CStr> for CString

1.0.0 · Source§

impl AsRef<OsStr> for Component<'_>

1.0.0 · Source§

impl AsRef<OsStr> for str

1.0.0 · Source§

impl AsRef<OsStr> for devela::all::IterPath<'_>

1.0.0 · Source§

impl AsRef<OsStr> for Components<'_>

1.0.0 · Source§

impl AsRef<OsStr> for Path

1.0.0 · Source§

impl AsRef<OsStr> for PathBuf

1.0.0 · Source§

impl AsRef<OsStr> for devela::all::String

1.0.0 · Source§

impl AsRef<OsStr> for OsStr

1.0.0 · Source§

impl AsRef<OsStr> for OsString

Source§

impl AsRef<LocalWaker> for Waker

Source§

impl AsRef<[f32; 2]> for Vec2

Source§

impl AsRef<[f32; 3]> for Vec3A

Source§

impl AsRef<[f32; 3]> for Vec3

Source§

impl AsRef<[f32; 4]> for Mat2

Source§

impl AsRef<[f32; 4]> for Quat

Source§

impl AsRef<[f32; 4]> for Vec4

Source§

impl AsRef<[f32; 9]> for Mat3

Source§

impl AsRef<[f32; 16]> for Mat4

Source§

impl AsRef<[f64; 2]> for DVec2

Source§

impl AsRef<[f64; 3]> for DVec3

Source§

impl AsRef<[f64; 4]> for DMat2

Source§

impl AsRef<[f64; 4]> for DQuat

Source§

impl AsRef<[f64; 4]> for DVec4

Source§

impl AsRef<[f64; 9]> for DMat3

Source§

impl AsRef<[f64; 16]> for DMat4

Source§

impl AsRef<[i8; 2]> for I8Vec2

Source§

impl AsRef<[i8; 3]> for I8Vec3

Source§

impl AsRef<[i8; 4]> for I8Vec4

Source§

impl AsRef<[i16; 2]> for I16Vec2

Source§

impl AsRef<[i16; 3]> for I16Vec3

Source§

impl AsRef<[i16; 4]> for I16Vec4

Source§

impl AsRef<[i32; 2]> for IVec2

Source§

impl AsRef<[i32; 3]> for IVec3

Source§

impl AsRef<[i32; 4]> for IVec4

Source§

impl AsRef<[i64; 2]> for I64Vec2

Source§

impl AsRef<[i64; 3]> for I64Vec3

Source§

impl AsRef<[i64; 4]> for I64Vec4

Source§

impl AsRef<[u8; 2]> for U8Vec2

Source§

impl AsRef<[u8; 3]> for U8Vec3

Source§

impl AsRef<[u8; 4]> for U8Vec4

1.0.0 · Source§

impl AsRef<[u8]> for str

§

impl AsRef<[u8]> for PyBackedBytes

§

impl AsRef<[u8]> for PyBackedStr

§

impl AsRef<[u8]> for BStr

§

impl AsRef<[u8]> for devela::_dep::winnow::Bytes

1.0.0 · Source§

impl AsRef<[u8]> for devela::all::String

§

impl AsRef<[u8]> for Bytes

§

impl AsRef<[u8]> for BytesMut

Source§

impl AsRef<[u16; 2]> for U16Vec2

Source§

impl AsRef<[u16; 3]> for U16Vec3

Source§

impl AsRef<[u16; 4]> for U16Vec4

Source§

impl AsRef<[u32; 2]> for UVec2

Source§

impl AsRef<[u32; 3]> for UVec3

Source§

impl AsRef<[u32; 4]> for UVec4

Source§

impl AsRef<[u64; 2]> for U64Vec2

Source§

impl AsRef<[u64; 3]> for U64Vec3

Source§

impl AsRef<[u64; 4]> for U64Vec4

1.55.0 · Source§

impl<'a> AsRef<str> for devela::_dep::_alloc::string::Drain<'a>

1.55.0 · Source§

impl<'a> AsRef<[u8]> for devela::_dep::_alloc::string::Drain<'a>

§

impl<'a, T> AsRef<T> for devela::_dep::bumpalo::boxed::Box<'a, T>
where T: ?Sized,

1.46.0 · Source§

impl<'a, T, A> AsRef<[T]> for devela::_dep::_alloc::vec::Drain<'a, T, A>
where A: Allocator,

§

impl<'bump> AsRef<str> for devela::_dep::bumpalo::collections::String<'bump>

§

impl<'bump> AsRef<[u8]> for devela::_dep::bumpalo::collections::String<'bump>

§

impl<'bump, T> AsRef<[T]> for devela::_dep::bumpalo::collections::Vec<'bump, T>
where T: 'bump,

§

impl<'bump, T> AsRef<Vec<'bump, T>> for devela::_dep::bumpalo::collections::Vec<'bump, T>
where T: 'bump,

§

impl<'py, T> AsRef<Bound<'py, PyAny>> for Bound<'py, T>

§

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

§

impl<D> AsRef<ContentStyle> for StyledContent<D>
where D: Display,

§

impl<I> AsRef<I> for LocatingSlice<I>

§

impl<I, S> AsRef<I> for Stateful<I, S>

Source§

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

Source§

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

Source§

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

§

impl<T> AsRef<[T; 2]> for Point2<T>

§

impl<T> AsRef<[T; 2]> for Vector2<T>

§

impl<T> AsRef<[T; 3]> for Point3<T>

§

impl<T> AsRef<[T; 3]> for Vector3<T>

§

impl<T> AsRef<[T; 4]> for ColumnMatrix2<T>

§

impl<T> AsRef<[T; 4]> for Quaternion<T>

§

impl<T> AsRef<[T; 4]> for RowMatrix2<T>

§

impl<T> AsRef<[T; 4]> for Vector4<T>

§

impl<T> AsRef<[T; 6]> for ColumnMatrix2x3<T>

§

impl<T> AsRef<[T; 6]> for ColumnMatrix3x2<T>

§

impl<T> AsRef<[T; 6]> for RowMatrix2x3<T>

§

impl<T> AsRef<[T; 6]> for RowMatrix3x2<T>

§

impl<T> AsRef<[T; 8]> for ColumnMatrix2x4<T>

§

impl<T> AsRef<[T; 8]> for ColumnMatrix4x2<T>

§

impl<T> AsRef<[T; 8]> for RowMatrix2x4<T>

§

impl<T> AsRef<[T; 8]> for RowMatrix4x2<T>

§

impl<T> AsRef<[T; 9]> for ColumnMatrix3<T>

§

impl<T> AsRef<[T; 9]> for RowMatrix3<T>

§

impl<T> AsRef<[T; 12]> for ColumnMatrix3x4<T>

§

impl<T> AsRef<[T; 12]> for ColumnMatrix4x3<T>

§

impl<T> AsRef<[T; 12]> for RowMatrix3x4<T>

§

impl<T> AsRef<[T; 12]> for RowMatrix4x3<T>

§

impl<T> AsRef<[T; 16]> for ColumnMatrix4<T>

§

impl<T> AsRef<[T; 16]> for RowMatrix4<T>

1.0.0 · Source§

impl<T> AsRef<[T]> for [T]

§

impl<T> AsRef<[T]> for SerVec<T>

§

impl<T> AsRef<[T]> for ArchivedVec<T>

1.13.0 · Source§

impl<T> AsRef<[T]> for devela::_core::slice::Iter<'_, T>

1.53.0 · Source§

impl<T> AsRef<[T]> for IterMut<'_, T>

Source§

impl<T> AsRef<JsValue> for Closure<T>
where T: ?Sized,

1.0.0 · Source§

impl<T> AsRef<T> for Cow<'_, T>
where T: ToOwned + ?Sized,

§

impl<T> AsRef<T> for ArchivedBox<T>
where T: ArchivePointee + ?Sized,

§

impl<T> AsRef<T> for Seal<'_, T>
where T: ?Sized,

Source§

impl<T> AsRef<T> for BareBox<T>

§

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

§

impl<T> AsRef<[[T; 2]; 2]> for ColumnMatrix2<T>

§

impl<T> AsRef<[[T; 2]; 2]> for RowMatrix2<T>

§

impl<T> AsRef<[[T; 2]; 3]> for ColumnMatrix2x3<T>

§

impl<T> AsRef<[[T; 2]; 3]> for RowMatrix3x2<T>

§

impl<T> AsRef<[[T; 2]; 4]> for ColumnMatrix2x4<T>

§

impl<T> AsRef<[[T; 2]; 4]> for RowMatrix4x2<T>

§

impl<T> AsRef<[[T; 3]; 2]> for ColumnMatrix3x2<T>

§

impl<T> AsRef<[[T; 3]; 2]> for RowMatrix2x3<T>

§

impl<T> AsRef<[[T; 3]; 3]> for ColumnMatrix3<T>

§

impl<T> AsRef<[[T; 3]; 3]> for RowMatrix3<T>

§

impl<T> AsRef<[[T; 3]; 4]> for ColumnMatrix3x4<T>

§

impl<T> AsRef<[[T; 3]; 4]> for RowMatrix4x3<T>

§

impl<T> AsRef<[[T; 4]; 2]> for ColumnMatrix4x2<T>

§

impl<T> AsRef<[[T; 4]; 2]> for RowMatrix2x4<T>

§

impl<T> AsRef<[[T; 4]; 3]> for ColumnMatrix4x3<T>

§

impl<T> AsRef<[[T; 4]; 3]> for RowMatrix3x4<T>

§

impl<T> AsRef<[[T; 4]; 4]> for ColumnMatrix4<T>

§

impl<T> AsRef<[[T; 4]; 4]> for RowMatrix4<T>

1.46.0 · Source§

impl<T, A> AsRef<[T]> for IntoIter<T, A>
where A: Allocator,

1.0.0 · Source§

impl<T, A> AsRef<[T]> for devela::all::Vec<T, A>
where A: Allocator,

1.0.0 · Source§

impl<T, A> AsRef<Vec<T, A>> for devela::all::Vec<T, A>
where A: Allocator,

Source§

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

1.5.0 · Source§

impl<T, A> AsRef<T> for devela::all::Box<T, A>
where A: Allocator, T: ?Sized,

1.5.0 · Source§

impl<T, A> AsRef<T> for Rc<T, A>
where A: Allocator, T: ?Sized,

1.5.0 · Source§

impl<T, A> AsRef<T> for Arc<T, A>
where A: Allocator, T: ?Sized,

§

impl<T, F> AsRef<T> for ArchivedRc<T, F>
where T: ArchivePointee + ?Sized,

1.0.0 · Source§

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

1.0.0 · Source§

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

§

impl<T, U> AsRef<U> for PyRef<'_, T>
where T: PyClass<BaseType = U>, U: PyClass,

§

impl<T, U> AsRef<U> for PyRefMut<'_, T>
where U: PyClass<Frozen = False>, T: PyClass<BaseType = U, Frozen = False>,

Source§

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

Source§

impl<T, const CAP: usize, S: Storage> AsRef<[T; CAP]> for devela::all::Array<T, CAP, S>

Source§

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

1.0.0 · Source§

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

§

impl<T, const N: usize> AsRef<[T]> for InlineVec<T, N>

Source§

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

§

impl<const A: usize> AsRef<[u8]> for AlignedVec<A>

Source§

impl<const CAP: usize> AsRef<str> for StringNonul<CAP>

Available on crate feature _string_nonul only.
Source§

impl<const CAP: usize> AsRef<str> for StringU8<CAP>

Source§

impl<const CAP: usize> AsRef<str> for StringU16<CAP>

Source§

impl<const CAP: usize> AsRef<str> for StringU32<CAP>

Source§

impl<const CAP: usize> AsRef<str> for StringUsize<CAP>

Source§

impl<const CAP: usize> AsRef<str> for ArrayString<CAP>

Source§

impl<const CAP: usize> AsRef<Path> for ArrayString<CAP>

Source§

impl<const CAP: usize> AsRef<OsStr> for StringU8<CAP>

Available on crate feature std and (Unix or WASI) only.
Source§

impl<const CAP: usize> AsRef<OsStr> for StringU16<CAP>

Available on crate feature std and (Unix or WASI) only.
Source§

impl<const CAP: usize> AsRef<OsStr> for StringU32<CAP>

Available on crate feature std and (Unix or WASI) only.
Source§

impl<const CAP: usize> AsRef<OsStr> for StringUsize<CAP>

Available on crate feature std and (Unix or WASI) only.
Source§

impl<const CAP: usize> AsRef<[u8]> for StringNonul<CAP>

Available on crate feature _string_nonul only.
Source§

impl<const CAP: usize> AsRef<[u8]> for StringU8<CAP>

Source§

impl<const CAP: usize> AsRef<[u8]> for StringU16<CAP>

Source§

impl<const CAP: usize> AsRef<[u8]> for StringU32<CAP>

Source§

impl<const CAP: usize> AsRef<[u8]> for StringUsize<CAP>