Skip to content
PathOp

PathOp

Mojo struct 🡭

PathOp

@memory_only
struct PathOp

Which builder call a PathCommand records: one of MOVE_TO, LINE_TO, QUAD_TO, CUBIC_TO, CLOSE, ARC_TO. Prints as its name, so assert_equal(cmd.op, PathOp.MOVE_TO) reports which op it found.

Aliases

  • MOVE_TO = PathOp(Int(0))
  • LINE_TO = PathOp(Int(1))
  • QUAD_TO = PathOp(Int(2))
  • CUBIC_TO = PathOp(Int(3))
  • CLOSE = PathOp(Int(4))
  • ARC_TO = PathOp(Int(5))

Implemented traits

AnyType, Copyable, Deinitable, Equatable, ImplicitlyCopyable, Movable, Writable

Methods

__init__

fn def __init__(out self, value: Int)

Prefer the comptime constants over constructing one directly.

Args:

  • value (Int): 0 MOVE_TO, 1 LINE_TO, 2 QUAD_TO, 3 CUBIC_TO, 4 CLOSE, 5 ARC_TO.
  • self (Self)

Returns:

Self

__eq__

fn def __eq__(self, other: Self) -> Bool

Args:

  • self (Self)
  • other (Self)

Returns:

Bool

__ne__

fn def __ne__(self, other: Self) -> Bool

Args:

  • self (Self)
  • other (Self)

Returns:

Bool

write_to

fn def write_to[W: Writer](self, mut writer: W)

Parameters:

  • W (Writer)

Args:

  • self (Self)
  • writer (W)

__str__

fn def __str__(self) -> String

Args:

  • self (Self)

Returns:

String