Struct libnotcurses_sys::NcPlaneOptionsBuilder
source · [−]pub struct NcPlaneOptionsBuilder { /* private fields */ }Expand description
Builder object for NcPlaneOptions.
Can be constructed by calling NcPlaneOptions::builder().
By default it has the Marginalized flag already set, alongside (0, 0)
margins, so that it automatically fills the parent plane.
Implementations
sourceimpl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
New NcPlaneOptionsBuilder with the Marginalized flag set.
sourcepub fn from_options(options: &NcPlaneOptions) -> Self
pub fn from_options(options: &NcPlaneOptions) -> Self
New builder from pre-existing options.
sourcepub fn build(self) -> NcPlaneOptions
pub fn build(self) -> NcPlaneOptions
Finishes the building and returns NcPlaneOptions.
sourceimpl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn y(self, y: i32) -> Self
pub fn y(self, y: i32) -> Self
Sets the vertical placement relative to parent plane.
Default: 0.
Effect: Sets the y coordinate and unsets the VerAligned flag.
sourcepub fn x(self, x: i32) -> Self
pub fn x(self, x: i32) -> Self
Sets the horizontal placement relative to parent plane.
Default: 0.
Effect: Sets the x coordinate and unsets the HorAligned flag.
sourcepub fn yx(self, y: i32, x: i32) -> Self
pub fn yx(self, y: i32, x: i32) -> Self
Sets the vertical & horizontal placement relative to parent plane.
Effect: Sets the x & y coordinates and unsets the VERALIGNED
and HORALIGNED flags.
Default: (0, 0).
sourcepub fn valign(self, v: impl Into<NcAlign>) -> Self
pub fn valign(self, v: impl Into<NcAlign>) -> Self
Sets the vertical alignment.
Default: NcAlign::Top.
Effect: Sets the v alignment and the VerAligned flag.
sourcepub fn halign(self, h: impl Into<NcAlign>) -> Self
pub fn halign(self, h: impl Into<NcAlign>) -> Self
Sets the horizontal alignment.
Default: NcAlign::Left.
Effect: Sets the h alignment and the HorAligned flag.
sourcepub fn align(self, v: impl Into<NcAlign>, h: impl Into<NcAlign>) -> Self
pub fn align(self, v: impl Into<NcAlign>, h: impl Into<NcAlign>) -> Self
Sets the vertical & horizontal alignment.
Default: (NcAlign::Top, NcAlign::Left).
Effect: Sets the v & h alignments and the VerAligned
& HorAligned flags.
sourcepub fn rows(self, rows: u32) -> Self
pub fn rows(self, rows: u32) -> Self
Sets the number of rows for the plane.
Must be >0 when not using margins.
Default: 0.
Effect: sets the rows field and unsets the Marginalized flag.
sourcepub fn cols(self, cols: u32) -> Self
pub fn cols(self, cols: u32) -> Self
Sets the number of columns for the plane.
Must be >0 when not using margins.
Default: 0.
Effect: sets the cols field and unsets the Marginalized flag.
sourcepub fn rows_cols(self, rows: u32, cols: u32) -> Self
pub fn rows_cols(self, rows: u32, cols: u32) -> Self
Sets the number of rows & columns for the plane.
Must be >0 when not using margins.
Default: (0, 0).
Effect: sets the rows & cols fields and unsets the Marginalized
flag.
sourcepub fn margins(self, bottom: u32, right: u32) -> Self
pub fn margins(self, bottom: u32, right: u32) -> Self
Sets the bottom & right margins.
Default: (0, 0).
Effect: sets the margin_b & margin_r fields and the Marginalized
flag.
sourcepub fn fixed(self, fixed: bool) -> Self
pub fn fixed(self, fixed: bool) -> Self
If true, the plane will not scroll with the parent.
Default: false (scrolls with the parent).
Effect: (un)sets the Fixed flag.
sourcepub fn vscroll(self, vscroll: bool) -> Self
pub fn vscroll(self, vscroll: bool) -> Self
If true, the plane will scroll vertically to accommodate output.
Setting this flag is equivalent to immediately calling
set_scrolling(true) following NcPlane creation.
Default: false.
Effect: (un)sets the VScroll flag.
See also: AutoGrow.
sourcepub fn resizecb(self, callback: Option<NcResizeCb>) -> Self
pub fn resizecb(self, callback: Option<NcResizeCb>) -> Self
(Un)Sets the resize callback.
Default: None.
sourceimpl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn set_y(&mut self, y: i32)
pub fn set_y(&mut self, y: i32)
Sets the vertical placement relative to parent plane.
Default: 0.
Effect: Sets the y coordinate and unsets the VerAligned flag.
sourcepub fn set_x(&mut self, x: i32)
pub fn set_x(&mut self, x: i32)
Sets the horizontal placement relative to parent plane.
Default: 0.
Effect: Sets the x coordinate and unsets the HorAligned flag.
sourcepub fn set_yx(&mut self, y: i32, x: i32)
pub fn set_yx(&mut self, y: i32, x: i32)
Sets the vertical & horizontal placement relative to parent plane.
Effect: Sets the x & y coordinates and unsets the VERALIGNED
and HORALIGNED flags.
Default: (0, 0).
sourcepub fn set_valign(&mut self, v: impl Into<NcAlign>)
pub fn set_valign(&mut self, v: impl Into<NcAlign>)
Sets the vertical alignment.
Default: NcAlign::Top.
Effect: Sets the y alignment and the VerAligned flag.
sourcepub fn set_halign(&mut self, h: impl Into<NcAlign>)
pub fn set_halign(&mut self, h: impl Into<NcAlign>)
Sets the horizontal alignment.
Default: NcAlign::Left.
Effect: Sets the h alignment and the HorAligned flag.
sourcepub fn set_align(&mut self, v: impl Into<NcAlign>, h: impl Into<NcAlign>)
pub fn set_align(&mut self, v: impl Into<NcAlign>, h: impl Into<NcAlign>)
Sets the vertical & horizontal alignment.
Default: (NcAlign::Top, NcAlign::Left).
Effect: Sets the v & h alignments and the VerAligned
& HorAligned flags.
sourcepub fn set_rows(&mut self, rows: u32)
pub fn set_rows(&mut self, rows: u32)
Sets the number of rows for the plane.
Must be >0 when not using margins.
Default: 0.
Effect: sets the rows field and unsets the Marginalized flag.
sourcepub fn set_cols(&mut self, cols: u32)
pub fn set_cols(&mut self, cols: u32)
Sets the number of columns for the plane.
Must be >0 when not using margins.
Default: 0.
Effect: sets the cols field and unsets the Marginalized flag.
sourcepub fn set_rows_cols(&mut self, rows: u32, cols: u32)
pub fn set_rows_cols(&mut self, rows: u32, cols: u32)
Sets the number of rows & columns for the plane.
Must be >0 when not using margins.
Default: (0, 0).
Effect: sets the rows & cols fields and unsets the Marginalized
flag.
sourcepub fn set_margins(&mut self, bottom: u32, right: u32)
pub fn set_margins(&mut self, bottom: u32, right: u32)
Sets the bottom & right margins.
Default: (0, 0).
Effect: sets the margin_b & margin_r fields and the Marginalized
flag.
sourcepub fn set_fixed(&mut self, fixed: bool)
pub fn set_fixed(&mut self, fixed: bool)
If true, the plane will not scroll with the parent.
Default: false (scrolls with the parent).
Effect: (un)sets the Fixed flag.
sourcepub fn set_vscroll(&mut self, vscroll: bool)
pub fn set_vscroll(&mut self, vscroll: bool)
If true, the plane will scroll vertically to accommodate output.
Setting this flag is equivalent to immediately calling
set_scrolling(true) following NcPlane creation.
Default: false.
Effect: (un)sets the VScroll flag.
See also: AutoGrow.
sourcepub fn set_autogrow(&mut self, autogrow: bool)
pub fn set_autogrow(&mut self, autogrow: bool)
sourcepub fn set_resizecb(&mut self, callback: Option<NcResizeCb>)
pub fn set_resizecb(&mut self, callback: Option<NcResizeCb>)
(Un)Sets the resize callback.
Default: None.
Trait Implementations
sourceimpl Clone for NcPlaneOptionsBuilder
impl Clone for NcPlaneOptionsBuilder
sourcefn clone(&self) -> NcPlaneOptionsBuilder
fn clone(&self) -> NcPlaneOptionsBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for NcPlaneOptionsBuilder
impl Debug for NcPlaneOptionsBuilder
sourceimpl Default for NcPlaneOptionsBuilder
impl Default for NcPlaneOptionsBuilder
sourcefn default() -> Self
fn default() -> Self
New NcPlaneOptionsBuilder with the Marginalized flag set.
sourceimpl From<&NcPlaneOptionsBuilder> for NcPlaneOptions
impl From<&NcPlaneOptionsBuilder> for NcPlaneOptions
sourcefn from(builder: &NcPlaneOptionsBuilder) -> Self
fn from(builder: &NcPlaneOptionsBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<&mut NcPlaneOptionsBuilder> for NcPlaneOptions
impl From<&mut NcPlaneOptionsBuilder> for NcPlaneOptions
sourcefn from(builder: &mut NcPlaneOptionsBuilder) -> Self
fn from(builder: &mut NcPlaneOptionsBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<&mut ncplane_options> for NcPlaneOptionsBuilder
impl From<&mut ncplane_options> for NcPlaneOptionsBuilder
sourcefn from(options: &mut NcPlaneOptions) -> Self
fn from(options: &mut NcPlaneOptions) -> Self
Converts to this type from the input type.
sourceimpl From<&ncplane_options> for NcPlaneOptionsBuilder
impl From<&ncplane_options> for NcPlaneOptionsBuilder
sourcefn from(options: &NcPlaneOptions) -> Self
fn from(options: &NcPlaneOptions) -> Self
Converts to this type from the input type.
sourceimpl From<NcPlaneOptionsBuilder> for NcPlaneOptions
impl From<NcPlaneOptionsBuilder> for NcPlaneOptions
sourcefn from(builder: NcPlaneOptionsBuilder) -> NcPlaneOptions
fn from(builder: NcPlaneOptionsBuilder) -> NcPlaneOptions
Converts to this type from the input type.
sourceimpl From<ncplane_options> for NcPlaneOptionsBuilder
impl From<ncplane_options> for NcPlaneOptionsBuilder
sourcefn from(options: NcPlaneOptions) -> NcPlaneOptionsBuilder
fn from(options: NcPlaneOptions) -> NcPlaneOptionsBuilder
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for NcPlaneOptionsBuilder
impl Send for NcPlaneOptionsBuilder
impl Sync for NcPlaneOptionsBuilder
impl Unpin for NcPlaneOptionsBuilder
impl UnwindSafe for NcPlaneOptionsBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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