Struct wyz::comu::Address

source ·
pub struct Address<M, T>where
    M: Mutability,
    T: ?Sized,
{ /* private fields */ }
Expand description

A generic non-null pointer with type-system mutability tracking.

Type Parameters

  • M: The mutability permissions of the source pointer.
  • T: The referent type of the source pointer.

Implementations§

The dangling pointer.

Constructs a new Address over some pointer value.

You are responsible for selecting the correct Mutability marker.

Permanently converts an Address<_> into an Address<Const>.

You should generally prefer Address::freeze.

Force an Address<Const> to be Address<Mut>.

Safety

You should only call this on addresses you know to have been created with Mutable permissions and previously removed by Address::immut.

You should prefer using Address::freeze for temporary, trackable, immutability constraints instead.

Freezes the Address so that it is read-only.

Removes the Address type marker, returning the original pointer.

Gets the address as a read-only pointer.

Gets the address as a write-capable pointer.

Thaws the Address to its original mutability permission.

Port of the pointer inherent methods on Addresses of Sized types.

Applies <*T>::cast.

See original documentation.

Applies <*T>::offset.

See original documentation.

Applies <*T>::add.

See original documentation.

Applies <*T>::sub.

See original documentation.

Applies <*T>::wrapping_offset.

See original documentation.

Applies <*T>::wrapping_add.

See original documentation.

Applies <*T>::wrapping_sub.

See original documentation.

Applies <*T>::offset_from.

See original documentation.

Applies <*T>::read.

See original documentation.

Applies <*T>::read_volatile.

See original documentation.

Applies <*T>::read_unaligned.

See original documentation.

Applies <*T>::copy_to.

See original documentation.

Applies <*T>::copy_to_nonoverlapping.

See original documentation.

Applies <*T>::align_offset.

See original documentation.

Port of the pointer inherent methods on Addresses of any type.

Applies <*T>::as_ref.

See original documentation.

Port of pointer inherent methods on mutable Addresses of sized types.

Applies <*T>::copy_from.

See original documentation.

Applies <*T>::copy_from_nonoverlapping.

See original documentation.

Applies <*T>::write.

See original documentation.

Applies <*T>::write_volatile.

See original documentation.

Applies <*T>::write_unaligned.

See original documentation.

Applies <*T>::replace.

See original documentation.

Applies <*T>::swap.

See original documentation.

Port of pointer inherent methods on mutable Addresses of any type.

Applies <*T>::as_mut.

See original documentation.

Applies <*T>::drop_in_place.

See original documentation.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Formats the value using the given formatter.
The created reference type. Must be one of &T or &mut T.
Converts the Address to a reference. Read more
Converts a reference back into an Address.
The created reference type. Must be one of &T or &mut T.
Converts the Address to a reference. Read more
Converts a reference back into an Address.
The created reference type. Must be one of &T or &mut T.
Converts the Address to a reference. Read more
Converts a reference back into an Address.
The type of the element pointer.
Constructs an ordinary slice reference from a base-address and a length. Read more
The type of the element pointer.
Constructs an ordinary slice reference from a base-address and a length. Read more
The type of the element pointer.
Constructs an ordinary slice reference from a base-address and a length. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted. Read more
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted. Read more
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.