Struct field_offset::FieldOffset [] [src]

pub struct FieldOffset<T, U>(_, _);

Represents a pointer to a field of type U within the type T

Methods

impl<T, U> FieldOffset<T, U>
[src]

Construct a field offset via a lambda which returns a reference to the field in question.

The lambda must not access the value passed in.

Construct a field offset directly from a byte offset.

Apply the field offset to a native pointer.

Apply the field offset to a native mutable pointer.

Apply the field offset to a reference.

Apply the field offset to a mutable reference.

Get the raw byte offset for this field offset.

Unapply the field offset to a native pointer.

Warning: very unsafe!

Unapply the field offset to a native mutable pointer.

Warning: very unsafe!

Unapply the field offset to a reference.

Warning: very unsafe!

Unapply the field offset to a mutable reference.

Warning: very unsafe!

Trait Implementations

impl<T, U, V> Add<FieldOffset<U, V>> for FieldOffset<T, U>
[src]

Allow chaining pointer-to-members.

Applying the resulting field offset is equivalent to applying the first field offset, then applying the second field offset.

The requirements on the generic type parameters ensure this is a safe operation.

The resulting type after applying the + operator

The method for the + operator

impl<T, U> Debug for FieldOffset<T, U>
[src]

The debug implementation prints the byte offset of the field in hexadecimal.

Formats the value using the given formatter.

impl<T, U> Copy for FieldOffset<T, U>
[src]

impl<T, U> Clone for FieldOffset<T, U>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more