pub enum Element<L> {
Instance(RawInstance<L>),
Shape(Shape<L>),
Text(Text<L>),
}
Expand description
A primitive layout element.
Variants§
Instance(RawInstance<L>)
A raw layout instance.
Shape(Shape<L>)
A primitive layout shape.
Text(Text<L>)
A primitive text annotation.
Implementations§
Source§impl<L> Element<L>
impl<L> Element<L>
Sourcepub fn as_ref(&self) -> ElementRef<'_, L>
pub fn as_ref(&self) -> ElementRef<'_, L>
Converts from &Element
to ElementRef
.
Produces a new ElementRef
containing a reference into
the original element, but leaves the original in place.
Sourcepub fn instance(self) -> Option<RawInstance<L>>
pub fn instance(self) -> Option<RawInstance<L>>
If this is an Instance
variant, returns the contained instance.
Otherwise, returns None
.
Trait Implementations§
Source§impl<L> From<RawInstance<L>> for Element<L>
impl<L> From<RawInstance<L>> for Element<L>
Source§fn from(value: RawInstance<L>) -> Self
fn from(value: RawInstance<L>) -> Self
Converts to this type from the input type.
Source§impl<L> TransformMut for Element<L>
impl<L> TransformMut for Element<L>
Source§fn transform_mut(&mut self, trans: Transformation)
fn transform_mut(&mut self, trans: Transformation)
Applies matrix-vector
Transformation
trans
.Source§impl<L: Clone> TransformRef for Element<L>
impl<L: Clone> TransformRef for Element<L>
Source§fn transform_ref(&self, trans: Transformation) -> Self
fn transform_ref(&self, trans: Transformation) -> Self
Applies matrix-vector
Transformation
trans
.Source§impl<L> TranslateMut for Element<L>
impl<L> TranslateMut for Element<L>
Source§fn translate_mut(&mut self, p: Point)
fn translate_mut(&mut self, p: Point)
Translates the shape by a
Point
through mutation.Source§impl<L: Clone> TranslateRef for Element<L>
impl<L: Clone> TranslateRef for Element<L>
Source§fn translate_ref(&self, p: Point) -> Self
fn translate_ref(&self, p: Point) -> Self
Translates the shape by
Point
, returning a new shape.impl<L> StructuralPartialEq for Element<L>
Auto Trait Implementations§
impl<L> Freeze for Element<L>where
L: Freeze,
impl<L> RefUnwindSafe for Element<L>where
L: RefUnwindSafe,
impl<L> Send for Element<L>
impl<L> Sync for Element<L>
impl<L> Unpin for Element<L>where
L: Unpin,
impl<L> UnwindSafe for Element<L>where
L: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> AlignBbox for Twhere
T: AlignBboxMut,
impl<T> AlignBbox for Twhere
T: AlignBboxMut,
Source§impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
Source§impl<T> AlignRect for Twhere
T: AlignRectMut,
impl<T> AlignRect for Twhere
T: AlignRectMut,
Source§impl<T> AlignRectMut for Twhere
T: Translate,
impl<T> AlignRectMut for Twhere
T: Translate,
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>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn 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>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which 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)
Converts
&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)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S, T> DrawBoxed<S> for T
impl<S, T> DrawBoxed<S> for T
Source§fn draw_boxed(self: Box<T>, recv: &mut DrawReceiver<S>) -> Result<(), Error>
fn draw_boxed(self: Box<T>, recv: &mut DrawReceiver<S>) -> Result<(), Error>
Draws
self
inside recv
.§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request