Struct pix_engine::shape::Line [−][src]
#[repr(transparent)]pub struct Line<T, const N: usize>(_);
Expand description
A Line
with start and end Points.
Please see the module-level documentation for examples.
Implementations
Sets the starting point of the line.
Returns Line
coordinates as [x1, y1, z1, x2, y2, z2]
.
Example
let p1 = point!(5, 10);
let p2 = point!(100, 100);
let l = Line::new(p1, p2);
assert_eq!(l.as_array(), [point!(5, 10), point!(100, 100)]);
Returns Line
coordinates as a byte slice &[x1, y1, z1, x2, y2, z2]
.
Example
let p1 = point!(5, 10);
let p2 = point!(100, 100);
let l = Line::new(p1, p2);
assert_eq!(l.as_bytes(), &[point!(5, 10), point!(100, 100)]);
Returns Line
coordinates as a mutable byte slice &mut [x1, y1, z1, x2, y2, z2]
.
Example
let p1 = point!(5, 10);
let p2 = point!(100, 100);
let mut l = Line::new(p1, p2);
for p in l.as_bytes_mut() {
*p += 5;
}
assert_eq!(l.as_bytes(), &[point!(10, 15), point!(105, 105)]);
Returns Self
with the numbers cast using as
operator.
Converts Line < T, N > to Line < U, N >.
Returns Line < T, N > with the nearest integers to the numbers. Round half-way cases away from 0.0.
Returns Line < T, N >with the largest integers less than or equal to the numbers.
Trait Implementations
impl<'de, T, const N: usize> Deserialize<'de> for Line<T, N> where
T: Serialize + DeserializeOwned,
impl<'de, T, const N: usize> Deserialize<'de> for Line<T, N> where
T: Serialize + DeserializeOwned,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Creates a value from an iterator. Read more
Returns the closest intersection point with a given line and distance along the line or
None
if there is no intersection.
Returns whether this line intersections with another line
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for Line<T, N> where
T: RefUnwindSafe,
impl<T, const N: usize> UnwindSafe for Line<T, N> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more