pub struct Split<T: Drawable, U: Drawable> {
pub amount: Box<dyn Fn(u32) -> u32>,
pub orientation: Orientation,
pub order: UpdateOrder,
pub first: T,
pub second: U,
}
Expand description
A split at a centain percent
Fields
amount: Box<dyn Fn(u32) -> u32>
How to split the window. The argument is the size of the window in the splitting direction (horizortal gives width, vertical gives height), and the return value is how many pixels the first element should take
orientation: Orientation
The orientation to split
order: UpdateOrder
The stepping order
first: T
The first content
second: U
The second content
Implementations
sourceimpl<T: Drawable, U: Drawable> Split<T, U>
impl<T: Drawable, U: Drawable> Split<T, U>
sourcepub fn new(
amount: Box<dyn Fn(u32) -> u32>,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
pub fn new(
amount: Box<dyn Fn(u32) -> u32>,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
Create a new Split
sourcepub fn new_ratio(
ratio: f64,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
pub fn new_ratio(
ratio: f64,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
Create a new Split
that splits by a ratio. The ratio must be between 0 and 1.
sourcepub fn new_const(
pixels: u32,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
pub fn new_const(
pixels: u32,
orientation: Orientation,
order: UpdateOrder,
first: T,
second: U
) -> Split<T, U>
Create a new Split
that split by a constant number of pixels.
Trait Implementations
sourceimpl<T: Drawable, U: Drawable> Drawable for Split<T, U>
impl<T: Drawable, U: Drawable> Drawable for Split<T, U>
sourcefn content_mut(&mut self) -> Vec<&mut dyn Drawable>
fn content_mut(&mut self) -> Vec<&mut dyn Drawable>
What this object contains, mutably
sourcefn draw(&self, canvas: &mut Canvas<Window>, pos: &Position, settings: DrawSettings)
fn draw(&self, canvas: &mut Canvas<Window>, pos: &Position, settings: DrawSettings)
Draw everything
sourcefn 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. Read more
impl<T: Drawable, U: Drawable> Send for Split<T, U>
Auto Trait Implementations
impl<T, U> !RefUnwindSafe for Split<T, U>
impl<T, U> !Sync for Split<T, U>
impl<T, U> Unpin for Split<T, U>where
T: Unpin,
U: Unpin,
impl<T, U> !UnwindSafe for Split<T, U>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more