[−][src]Trait guard_trait::Guarded
A trait for pointer types that uphold the guard invariants, namely that the pointer must be owned, and that it must dereference into a stable address.
Associated Types
type Target: ?Sized
The target pointee that this pointer may dereference into. There are no real restrictions
to what this type can be. However, the user must not assume that simply because a &Target
reference is protected, that references indirectly derived (via Deref
and other traits)
would also be protected.
Required methods
fn borrow_guarded(&self) -> &Self::Target
Borrow the pointee, into a fixed reference that can be sent directly and safely to e.g. memory-sharing completion-based I/O interfaces.
Implementors of such interfaces must however take buffers by reference to maintain safety.
Implementors
impl<T, U> Guarded for AssertSafe<T> where
T: Deref<Target = U>,
U: ?Sized,
[src]
T: Deref<Target = U>,
U: ?Sized,
type Target = U
fn borrow_guarded(&self) -> &Self::Target
[src]
impl<T, U> Guarded for Mapped<T, U> where
T: Guarded,
U: ?Sized,
[src]
T: Guarded,
U: ?Sized,
type Target = U
fn borrow_guarded(&self) -> &Self::Target
[src]
impl<T, U> Guarded for MappedMut<T, U> where
T: GuardedMut,
U: ?Sized,
[src]
T: GuardedMut,
U: ?Sized,
type Target = U
fn borrow_guarded(&self) -> &Self::Target
[src]
impl<T, U> Guarded for T where
T: Deref<Target = U> + StableDeref + 'static,
U: ?Sized,
[src]
T: Deref<Target = U> + StableDeref + 'static,
U: ?Sized,