pub struct Memory { /* private fields */ }
Expand description

bgfx-managed buffer of memory.

It can be created by either copying existing data through copy(...), or by referencing existing memory directly through reference(...).

Implementations

Copies the source data into a new bgfx-managed buffer.

IMPORTANT: If this buffer is never passed into a bgfx call, the memory will never be freed, and will leak.

Creates a reference to the source data for passing into bgfx. When using this constructor over the copy call, no copy will be created. bgfx will read the source memory directly.

Note That the data passed to this function must be keep alive during the whole duration of the program and is only really recommended for static data unless you know you know what you are doing. Thus this function is marked as unsafe because of this reason.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. 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.