Facet

Trait Facet 

Source
pub unsafe trait Facet<'facet>: 'facet {
    const SHAPE: &'static Shape;
}
Expand description

Allows querying the Shape of a type, which in turn lets us inspect any fields, build a value of this type progressively, etc.

The 'facet lifetime allows Facet to be derived for types that borrow from something else.

§Safety

If you implement this wrong, all the safe abstractions in facet-reflect, all the serializers, deserializers, the entire ecosystem is unsafe.

You’re responsible for describing the type layout properly, and annotating all the invariants.

Required Associated Constants§

Source

const SHAPE: &'static Shape

The shape of this type

Shape embeds all other constants of this trait.

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.

Implementations on Foreign Types§

Source§

impl Facet<'_> for IpAddr

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for SocketAddr

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for bool

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for char

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for f32

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for f64

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for str

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for ()

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for String

Available on crate feature alloc only.
Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for TypeId

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for Ipv4Addr

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for Ipv6Addr

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for RandomState

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for Path

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for PathBuf

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for Utf8Path

Source§

const SHAPE: &'static Shape

Source§

impl Facet<'_> for Utf8PathBuf

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for Cow<'a, str>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for i8

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for i16

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for i32

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for i64

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for i128

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for isize

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for u8

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for u16

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for u32

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for u64

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for u128

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for usize

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for Rc<str>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for Weak<str>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for Arc<str>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for Weak<str>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<i8>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<i16>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<i32>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<i64>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<i128>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<isize>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<u8>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<u16>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<u32>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<u64>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<u128>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NonZero<usize>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NotNan<f32>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for NotNan<f64>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for OrderedFloat<f32>

Source§

const SHAPE: &'static Shape

Source§

impl<'a> Facet<'a> for OrderedFloat<f64>

Source§

const SHAPE: &'static Shape

Source§

impl<'a, Idx> Facet<'a> for Range<Idx>
where Idx: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, K, V> Facet<'a> for BTreeMap<K, V>
where K: Facet<'a> + Eq + Ord, V: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, K, V, S> Facet<'a> for HashMap<K, V, S>
where K: Facet<'a> + Eq + Hash, V: Facet<'a>, S: 'a + Default + BuildHasher,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T0> Facet<'a> for (T0,)
where T0: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T0, T1> Facet<'a> for (T0, T1)
where T0: Facet<'a>, T1: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T0, T1, T2> Facet<'a> for (T0, T1, T2)
where T0: Facet<'a>, T1: Facet<'a>, T2: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T0, T1, T2, T3> Facet<'a> for (T0, T1, T2, T3)
where T0: Facet<'a>, T1: Facet<'a>, T2: Facet<'a>, T3: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Option<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for *const T
where T: Facet<'a> + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for *mut T
where T: Facet<'a> + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for &'a T
where T: Facet<'a> + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for &'a mut T
where T: Facet<'a> + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for [T]
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Box<T>
where T: Facet<'a> + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for BTreeSet<T>
where T: Facet<'a> + Eq + Ord,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Rc<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Weak<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Arc<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Weak<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for Vec<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for PhantomData<T>
where T: 'a + ?Sized,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T> Facet<'a> for NonNull<T>
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T, S> Facet<'a> for HashSet<T, S>
where T: Facet<'a> + Eq + Hash, S: Facet<'a> + Default + BuildHasher,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, T, const L: usize> Facet<'a> for [T; L]
where T: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, U> Facet<'a> for Rc<[U]>
where U: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, U> Facet<'a> for Weak<[U]>
where U: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, U> Facet<'a> for Arc<[U]>
where U: Facet<'a>,

Source§

const SHAPE: &'static Shape

Source§

impl<'a, U> Facet<'a> for Weak<[U]>
where U: Facet<'a>,

Source§

const SHAPE: &'static Shape

Implementors§

Source§

impl Facet<'_> for ConstTypeId

Source§

const SHAPE: &'static Shape

Source§

impl<'facet, T> Facet<'facet> for Opaque<T>
where T: 'facet,

Source§

const SHAPE: &'static Shape