Struct rsasl::DiscardOnDrop[][src]

pub struct DiscardOnDrop<A>(_)
where
    A: Discard
;
Expand description

If you have a value which implements Discard, you can use DiscardOnDrop::new(value) which will wrap the value. When the wrapper is dropped it will automatically call value.discard().

You can use the DiscardOnDrop::leak function to unwrap it (which returns value). This causes it to no longer call discard when it is dropped, which means it will leak memory unless you manually call discard.

See the module documentation for more details.

Implementations

Creates a new DiscardOnDrop.

When the DiscardOnDrop is dropped it will automatically call discarder.discard().

See the module documentation for more details.

Returns the wrapped discarder.

It will no longer automatically call discarder.discard(), so this will leak memory unless you manually call discarder.discard().

See the module documentation for more details.

This is implemented as a function (not a method) so that way it doesn’t interfere with any of the methods on discarder.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

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

Performs the conversion.

Performs the conversion.

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.