pub struct FrameRules { /* private fields */ }Expand description
Frame size rules
This is a special variant of SizeRules for frames. It is assumed that
frames are not stretchy (i.e. that min-size equals ideal-size); additionally
frame rules have a content offset and a minimum internal margin size.
Implementations§
Source§impl FrameRules
impl FrameRules
pub const ZERO: Self
Sourcepub const fn new(size: i32, inner: (u16, u16), outer: (u16, u16)) -> Self
pub const fn new(size: i32, inner: (u16, u16), outer: (u16, u16)) -> Self
Construct new FrameRules
All parameters use pairs (first, second) where first is the top/left
component. Parameters inner and outer are inner and outer margin
sizes respectively while size is the frame size.
Frames have an inner margin, whose size is the maximum of inner and
content margins. Additionally, frames have an external margin of size
outer.
Sourcepub fn surround(self, content: SizeRules) -> (SizeRules, i32, i32)
pub fn surround(self, content: SizeRules) -> (SizeRules, i32, i32)
Generate rules for content surrounded by this frame
Returns the tuple (rules, offset, size):
- the generated
rules - the content
offsetwithin the allocated rect - the size consumed by the frame and inner margins (thus the content’s
size will be that allocated for this object minus this
sizevalue)
Trait Implementations§
Source§impl Clone for FrameRules
impl Clone for FrameRules
Source§fn clone(&self) -> FrameRules
fn clone(&self) -> FrameRules
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameRules
impl Debug for FrameRules
impl Copy for FrameRules
Auto Trait Implementations§
impl Freeze for FrameRules
impl RefUnwindSafe for FrameRules
impl Send for FrameRules
impl Sync for FrameRules
impl Unpin for FrameRules
impl UnwindSafe for FrameRules
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer 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.