logo
pub struct PathCommands { /* private fields */ }
Expand description

The commands of a path encoded in a single array using IDs to refer to endpoints and control points externally.

PathCommands is a good fit when the a custom endpoint and control point types are needed or when their the user needs full control over their storage.

Representation

Path commands contains a single array of 32 bits integer values encoding path commands, endpoint IDs or control point IDs.

 __________________________________________________________________________
|       |          |      |          |         |              |          |
| Begin |EndpointID| Line |EndpointID|Quadratic|ControlPointId|EndpointID| ...
|_______|__________|______|__________|_________|______________|__________|_

Example

use lyon_path::{EndpointId, PathCommands};

let mut cmds = PathCommands::builder();

cmds.begin(EndpointId(0));
cmds.line_to(EndpointId(1));
cmds.line_to(EndpointId(2));
cmds.end(true);

let cmds = cmds.build();

Implementations

Creates a PathCommandsBuilder to create path commands.

Returns an iterator over the path commands.

Returns a view on the path commands.

Returns a view on a path made of these commands with endpoint and control point slices.

Returns an iterator over the path, with endpoints and control points.

Returns the event for a given event ID.

Returns the next event id within the path.

Returns the next event id within the sub-path.

Loops back to the first event after the end of the sub-path.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. 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.