Module

std::borrow

source

Re-exported from core::borrow.

Borrowed views of values through the Borrow trait.

Types

NoCapThe "no capability needed" marker for Borrow's Cap slot.
Borrowed!A Ref[T,'k] together with a shared read capability of its domain, so the value it points to can be compared.

Traits

BorrowA key's readable form Out, obtained by presenting the capability Cap that permits reading what the key points to.

Instances

Borrow[Ref[T, 'k], Shared!['k, 'q], Borrowed![T, 'k, 'q]]A Ref borrows as a Borrowed! through a Shared! capability of its domain.
Eq[Borrowed![T, 'k, 'q1], Borrowed![T, 'k, 'q2]]Two borrowed references are equal when the values they point to are.
Borrow[Str['k], C, Readable[C, Str['k]]]Text borrows as a Readable through any capability that can read it.

Instance declarations

instance Borrow[Ref[T, 'k], Shared!['k, 'q], Borrowed![T, 'k, 'q]]source

forall T, 'k, 'q.
instance Borrow[Ref[T, 'k], Shared!['k, 'q], Borrowed![T, 'k, 'q]] { ... }

A Ref borrows as a Borrowed! through a Shared! capability of its domain.

instance Eq[Borrowed![T, 'k, 'q1], Borrowed![T, 'k, 'q2]]source

forall T, 'k, 'q1, 'q2 where Copy[T], Eq[T, T], Sized[T].
instance Eq[Borrowed![T, 'k, 'q1], Borrowed![T, 'k, 'q2]] { ... }

Two borrowed references are equal when the values they point to are.

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]]] { ... }

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