pub struct ContentPadding {
pub top_dp: f32,
pub bottom_dp: f32,
}Expand description
Room above the first line and below the last line of an editor, in dp. It lies inside the
scrolled content, so the first line starts top_dp down and the room scrolls away with
it, and the last line can be scrolled bottom_dp clear of the end of the view.
Fields§
§top_dp: f32§bottom_dp: f32Implementations§
Source§impl ContentPadding
impl ContentPadding
pub const fn new(top_dp: f32, bottom_dp: f32) -> Self
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether there is no room on either side, in which case there is nothing to send.
Sourcepub fn to_bytes(&self) -> [u8; 8]
pub fn to_bytes(&self) -> [u8; 8]
The bytes the property carries: top, then bottom, little-endian.
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
The padding read back. None where the bytes are not eight, or either side is below
zero or not a number, which the Renderer refuses as well.
Trait Implementations§
Source§impl Clone for ContentPadding
impl Clone for ContentPadding
impl Copy for ContentPadding
Source§impl Debug for ContentPadding
impl Debug for ContentPadding
Source§impl Default for ContentPadding
impl Default for ContentPadding
Source§impl PartialEq for ContentPadding
impl PartialEq for ContentPadding
impl StructuralPartialEq for ContentPadding
Auto Trait Implementations§
impl Forget for ContentPadding
impl Freeze for ContentPadding
impl Move for ContentPadding
impl RefUnwindSafe for ContentPadding
impl Send for ContentPadding
impl Sync for ContentPadding
impl Unpin for ContentPadding
impl UnsafeUnpin for ContentPadding
impl UnwindSafe for ContentPadding
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