[−][src]Struct lyon_path::PathCommands
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
impl PathCommands
[src]
pub fn builder() -> PathCommandsBuilder
[src]
Creates a PathCommandsBuilder to create path commands.
pub fn iter(&self) -> Iter<'_>ⓘ
[src]
Returns an iterator over the path commands.
pub fn as_slice(&self) -> PathCommandsSlice<'_>
[src]
Returns a view on the path commands.
pub fn path_slice<'l, Endpoint, ControlPoint>(
&'l self,
endpoints: &'l [Endpoint],
control_points: &'l [ControlPoint]
) -> CommandsPathSlice<'_, Endpoint, ControlPoint>
[src]
&'l self,
endpoints: &'l [Endpoint],
control_points: &'l [ControlPoint]
) -> CommandsPathSlice<'_, Endpoint, ControlPoint>
Returns a view on a path made of these commands with endpoint and control point slices.
pub fn events<'l, Endpoint, ControlPoint>(
&'l self,
endpoints: &'l [Endpoint],
control_points: &'l [ControlPoint]
) -> Events<'_, Endpoint, ControlPoint>ⓘ
[src]
&'l self,
endpoints: &'l [Endpoint],
control_points: &'l [ControlPoint]
) -> Events<'_, Endpoint, ControlPoint>ⓘ
Returns an iterator over the path, with endpoints and control points.
pub fn event(&self, id: EventId) -> IdEvent
[src]
Returns the event for a given event ID.
pub fn next_event_id_in_path(&self, id: EventId) -> Option<EventId>
[src]
Returns the next event id within the path.
pub fn next_event_id_in_sub_path(&self, id: EventId) -> EventId
[src]
Returns the next event id within the sub-path.
Loops back to the first event after the end of the sub-path.
Trait Implementations
impl Clone for PathCommands
[src]
pub fn clone(&self) -> PathCommands
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PathCommands
[src]
impl<'l> Into<PathCommandsSlice<'l>> for &'l PathCommands
[src]
pub fn into(self) -> PathCommandsSlice<'l>
[src]
impl<'l> IntoIterator for &'l PathCommands
[src]
Auto Trait Implementations
impl RefUnwindSafe for PathCommands
[src]
impl Send for PathCommands
[src]
impl Sync for PathCommands
[src]
impl Unpin for PathCommands
[src]
impl UnwindSafe for PathCommands
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,