Module perms

Module perms 

Source
Expand description

Field borrowing permissions.

§Types

Mut, Const and No are unit structs whose type indicates the permission (borrowing status) of a field.

They just show up in error messages and it is not normally necessary to name them directly in user code. If specifying field permissions as a list, or in other unusual situations, you may need to refer to them explicitly.

§Traits

The traits are all helper traits used for type judo by code generated by the derive, often including unsafe code.

You should not need to implement these.

It is not sound to add user implementations of the unsafe traits.

Structs§

Const
Immutable access (permission marker unit struct)
Mut
Mutable access (permission marker unit struct)
No
No access (permission marker unit struct)

Traits§

Adjust
Adjustable partial type: Self but with field #FI accessible with permission P.
CanSplitInto
Permissions that could be reborrowed, simulaneously, as both R and S.
IsDowngradeFrom
Permissions that are no greater than P
IsMut
Permissions that allow mutable access.
IsRef
Permissions that allow immutable access.
IsRefOrNot
Permissions that might or might not allow access. (Ie, all of them.)