pub struct WithSize<T: Drawable> {
pub size: (u32, u32),
pub inner: T,
}
Expand description
A wrapper that makes an object have a known size
Fields§
§size: (u32, u32)
The size of the object
inner: T
The inner object
Implementations§
Trait Implementations§
Source§impl<T: Drawable> Drawable for WithSize<T>
impl<T: Drawable> Drawable for WithSize<T>
Source§fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
What this object contains, mutably
Source§fn step(&mut self)
fn step(&mut self)
When the user presses space, the state of the presentation is advanced. This
method is what is called.
Source§fn draw(
&self,
canvas: &mut Canvas<Window>,
pos: &Position,
settings: DrawSettings,
)
fn draw( &self, canvas: &mut Canvas<Window>, pos: &Position, settings: DrawSettings, )
Draw everything
Auto Trait Implementations§
impl<T> Freeze for WithSize<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithSize<T>where
T: RefUnwindSafe,
impl<T> Send for WithSize<T>
impl<T> Sync for WithSize<T>where
T: Sync,
impl<T> Unpin for WithSize<T>where
T: Unpin,
impl<T> UnwindSafe for WithSize<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> 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