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 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, valign: impl Into<NcAlign>) -> Self
pub fn valign(self, valign: impl Into<NcAlign>) -> Self
Sets the vertical alignment.
Default: NcAlign::Top
.
Effect: Sets the y
alignment and the VerAligned
flag.
sourcepub fn halign(self, halign: impl Into<NcAlign>) -> Self
pub fn halign(self, halign: impl Into<NcAlign>) -> Self
Sets the horizontal alignment.
Default: NcAlign::Left
.
Effect: Sets the x
alignment and the HorAligned
flag.
sourcepub fn align(self, halign: impl Into<NcAlign>) -> Self
pub fn align(self, halign: impl Into<NcAlign>) -> Self
Sets the vertical & horizontal alignment.
Default: (
NcAlign::Top
, NcAlign::Left
)
.
Effect: Sets the y
& x
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.
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more