Struct

core::slice::Readable

source
forall C, S.
exposed struct Readable {
    cap: C,
    bytes: S,
}

A byte view together with the capability that permits reading it, as one value: what Eq, Hash, and Format instances take, since an instance head must be a named type. core::borrow::Borrowed! is the same idea for a Ref. Copy exactly when C is (e.g. core::str::StaticRead).

Instances

instance Borrow[Str['k], C, Readable[C, Str['k]]]source

forall C, 'k where ReadBytes[C, Str['k]].
instance Borrow[Str['k], C, Readable[C, Str['k]]] { ... }

In core::borrow.

Text borrows as a Readable through any capability that can read it.

instance Format[Readable[C, S], W]source

forall C, S, W where ReadBytes[C, S], Copy[S], Writer[W].
instance Format[Readable[C, S], W] { ... }

In core::fmt.

A borrowed byte view formats as its bytes, read through its capability.

instance Eq[Readable[C1, S1], Readable[C2, S2]]source

forall C1, S1, C2, S2 where ReadBytes[C1, S1], ReadBytes[C2, S2], Copy[S1], Copy[S2].
instance Eq[Readable[C1, S1], Readable[C2, S2]] { ... }

In core::slice.

Readable views are equal when their bytes are (bytes_eq).

instance Hash[Readable[C, S]]source

forall C, S where ReadBytes[C, S], Copy[S].
instance Hash[Readable[C, S]] { ... }

In core::slice.

A readable view hashes its bytes (hash_bytes).

instance Eq[Buffer!, Readable[C, S]]source

forall C, S where ReadBytes[C, S], Copy[S].
instance Eq[Buffer!, Readable[C, S]] { ... }

In alloc::buffer.

A buffer equals a borrowed view with the same bytes, which lets a map keyed by Buffer! be searched with a view (HashMap!::find). The two Hash instances agree: both hash the bytes in order.