pub struct Drawable<T>where
T: Clone,{ /* private fields */ }
Expand description
Represents a shape that is made of points that can be drawn either as a outline or solid
Implementations§
Source§impl<T> Drawable<T>where
T: Clone,
impl<T> Drawable<T>where
T: Clone,
pub fn with_draw_type(&self, draw_type: DrawType) -> Drawable<T>
Source§impl<T> Drawable<T>
impl<T> Drawable<T>
pub fn with_translation<P>(&self, delta: P) -> Drawable<T>
pub fn with_move<P>(&self, xy: P) -> Drawable<T>
pub fn with_move_center<P>(&self, xy: P) -> Drawable<T>
pub fn with_scale(&self, scale: f32) -> Drawable<T>
pub fn with_scale_around<P>(&self, scale: f32, point: P) -> Drawable<T>
pub fn with_rotation(&self, degrees: isize) -> Drawable<T>
pub fn with_rotation_around<P>(&self, degrees: isize, point: P) -> Drawable<T>
pub fn left(&self) -> isize
pub fn right(&self) -> isize
pub fn top(&self) -> isize
pub fn bottom(&self) -> isize
Source§impl<T> Drawable<T>
impl<T> Drawable<T>
pub fn intersects_shape(&self, shape: &(dyn Shape + 'static)) -> Option<bool>
pub fn contains_shape(&self, shape: &(dyn Shape + 'static)) -> Option<bool>
pub fn intersects_drawable<S>(&self, drawable: &Drawable<S>) -> Option<bool>
pub fn contains_drawable<S>(&self, drawable: &Drawable<S>) -> Option<bool>
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Drawable<T>where
T: Clone + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Drawable<T>where
T: Clone + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Drawable<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Drawable<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<S> Renderable<S> for Drawable<S>
impl<S> Renderable<S> for Drawable<S>
Source§impl<T> Serialize for Drawable<T>
impl<T> Serialize for Drawable<T>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for Drawable<T>
impl<T> StructuralPartialEq for Drawable<T>where
T: Clone,
Auto Trait Implementations§
impl<T> Freeze for Drawable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Drawable<T>where
T: RefUnwindSafe,
impl<T> Send for Drawable<T>where
T: Send,
impl<T> Sync for Drawable<T>where
T: Sync,
impl<T> Unpin for Drawable<T>where
T: Unpin,
impl<T> UnwindSafe for Drawable<T>where
T: UnwindSafe,
Blanket Implementations§
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.