pub struct Animation(_);
Expand description

A lottie animation.

Implementations

Read a lottie animation from file. This file needs to be in JSON format; if you want to read telegram’s tgs files, you need to decompress them first.

Read a file from memory. External resources are resolved relative to resource_path.

Return the default viewport size of this animation.

Return the total duration of this animation in seconds.

Return the total number of frames in this animation.

Return the default framerate of this animation.

Maps position to frame number and returns it.

Render the contents of a frame into the buffer at a certain viewport size.

The buffer’s capacity must be at least size.width * size.height. It’s initial length or content doesn’t matter. The first size.width * size.height bytes of the buffer will be written to; and it’s length will be set exactly to size.width * size.height.

This operation will fail only if the buffer’s capacity isn’t large enough.

Trait Implementations

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

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 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.