Struct CircleSegment
pub struct CircleSegment {
pub center: Point,
pub outer_radius: f64,
pub inner_radius: f64,
pub start_angle: f64,
pub sweep_angle: f64,
}Expand description
A segment of a circle.
If inner_radius > 0, then the shape will be a doughnut segment.
Fields§
§center: PointThe center.
outer_radius: f64The outer radius.
inner_radius: f64The inner radius.
start_angle: f64The angle to start drawing the segment (in radians).
sweep_angle: f64The arc length of the segment (in radians).
Implementations§
§impl CircleSegment
impl CircleSegment
pub fn new(
center: impl Into<Point>,
outer_radius: f64,
inner_radius: f64,
start_angle: f64,
sweep_angle: f64,
) -> CircleSegment
pub fn new( center: impl Into<Point>, outer_radius: f64, inner_radius: f64, start_angle: f64, sweep_angle: f64, ) -> CircleSegment
Create a CircleSegment out of its constituent parts.
Trait Implementations§
§impl Add<Vec2> for CircleSegment
impl Add<Vec2> for CircleSegment
§type Output = CircleSegment
type Output = CircleSegment
The resulting type after applying the
+ operator.§fn add(self, v: Vec2) -> CircleSegment
fn add(self, v: Vec2) -> CircleSegment
Performs the
+ operation. Read more§impl Clone for CircleSegment
impl Clone for CircleSegment
§fn clone(&self) -> CircleSegment
fn clone(&self) -> CircleSegment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for CircleSegment
impl Debug for CircleSegment
§impl PartialEq for CircleSegment
impl PartialEq for CircleSegment
§impl Shape for CircleSegment
impl Shape for CircleSegment
§type PathElementsIter<'iter> = Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
type PathElementsIter<'iter> = Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
The iterator returned by the
path_elements method.§fn path_elements(
&self,
tolerance: f64,
) -> Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
fn path_elements( &self, tolerance: f64, ) -> Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
§fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
Convert into a Bézier path. Read more
§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
§fn as_path_slice(&self) -> Option<&[PathEl]>
fn as_path_slice(&self) -> Option<&[PathEl]>
If the shape is stored as a slice of path elements, make
that available. Read more
§impl Sub<Vec2> for CircleSegment
impl Sub<Vec2> for CircleSegment
§type Output = CircleSegment
type Output = CircleSegment
The resulting type after applying the
- operator.§fn sub(self, v: Vec2) -> CircleSegment
fn sub(self, v: Vec2) -> CircleSegment
Performs the
- operation. Read moreimpl Copy for CircleSegment
impl StructuralPartialEq for CircleSegment
Auto Trait Implementations§
impl Freeze for CircleSegment
impl RefUnwindSafe for CircleSegment
impl Send for CircleSegment
impl Sync for CircleSegment
impl Unpin for CircleSegment
impl UnsafeUnpin for CircleSegment
impl UnwindSafe for CircleSegment
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more