Struct termimad::Area[][src]

pub struct Area {
    pub left: u16,
    pub top: u16,
    pub width: u16,
    pub height: u16,
}
Expand description

A rectangular part of the screen

Fields

left: u16top: u16width: u16height: u16

Implementations

impl Area[src]

pub fn uninitialized() -> Area[src]

build a new area. You’ll need to set the position and size before you can use it

pub fn new(left: u16, top: u16, width: u16, height: u16) -> Area[src]

build a new area.

pub fn full_screen() -> Area[src]

build an area covering the whole terminal

pub fn contains(&self, x: u16, y: u16) -> bool[src]

tell whether the char at (x,y) is in the area

pub fn pad(&mut self, dx: u16, dy: u16)[src]

shrink the area

pub fn pad_for_max_width(&mut self, max_width: u16)[src]

symmetrically shrink the area if its width is bigger than max_width

pub fn scrollbar(&self, scroll: i32, content_height: i32) -> Option<(u16, u16)>[src]

Return an option which when filled contains a tupple with the top and bottom of the vertical scrollbar. Return none when the content fits the available space.

Trait Implementations

impl Clone for Area[src]

fn clone(&self) -> Area[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Area[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<Area> for Area[src]

fn eq(&self, other: &Area) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Area) -> bool[src]

This method tests for !=.

impl Eq for Area[src]

impl StructuralEq for Area[src]

impl StructuralPartialEq for Area[src]

Auto Trait Implementations

impl RefUnwindSafe for Area

impl Send for Area

impl Sync for Area

impl Unpin for Area

impl UnwindSafe for Area

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.