pub struct NcOptionsBuilder { /* private fields */ }
Expand description

Builder object for NcOptions.

Implementations§

source§

impl NcOptionsBuilder

§constructors

source

pub fn new() -> Self

New NcOptionsBuilder.

source

pub fn from_options(options: &NcOptions) -> Self

New builder from pre-existing options.

source

pub fn build(self) -> NcOptions

Finishes the building and returns NcOptions.

source§

impl NcOptionsBuilder

§methods (chainable)

source

pub fn log_level(self, log_level: NcLogLevel) -> Self

Sets the log level.

source

pub fn margins(self, top: u32, right: u32, bottom: u32, left: u32) -> Self

Sets the margins.

source

pub fn margin_top(self, top: u32) -> Self

Sets the top margin.

source

pub fn margin_right(self, right: u32) -> Self

Sets the right margin.

source

pub fn margin_bottom(self, bottom: u32) -> Self

Sets the bottom margin.

source

pub fn margin_left(self, left: u32) -> Self

Sets the left margin.

source

pub fn drain_input(self, drain: bool) -> Self

If true, Input may be freely dropped.

This ought be provided when the program does not intend to handle input. Otherwise, input can accumulate in internal buffers, eventually preventing Notcurses from processing terminal messages.

See NcFlag::DrainInput.

source

pub fn inhibit_set_locale(self, inhibit: bool) -> Self

If true, wont call setlocale().

See NcFlag::InhibitSetLocale.

source

pub fn no_alternate_screen(self, no_alternate: bool) -> Self

If true, wont enter alternate mode.

See NcFlag::NoAlternateScreen.

source

pub fn no_clear_bitmaps(self, no_clear: bool) -> Self

If true, wont try to clear any preexisting bitmaps.

See NcFlag::NoClearBitmaps.

source

pub fn no_font_changes(self, no_font_changes: bool) -> Self

If true, wont modify the font.

See NcFlag::NoFontChanges.

source

pub fn no_quit_sig_handlers(self, no_quit: bool) -> Self

If true, wont handle SIGINT, SIGSEGV, SIGABRT nor SIGQUIT.

See NcFlag::NoQuitSigHandlers.

source

pub fn no_winch_sig_handler(self, no_winch: bool) -> Self

If true, wont handle SIGWINCH.

See NcFlag::NoWinchSigHandler.

source

pub fn preserve_cursor(self, preserve: bool) -> Self

If true, will initializes the CLI plane’s virtual cursor to match the physical cursor at context creation time.

See NcFlag::PreserveCursor.

source

pub fn scrolling(self, scrolling: bool) -> Self

If true, will prepare the CLI plane in scrolling mode.

See NcFlag::Scrolling.

source

pub fn cli_mode(self, cli_mode: bool) -> Self

A shortcut for setting the following options together: no_alternate_screen, no_clear_bitmaps, preserve_cursor & scrolling.

See NcFlag::CliMode.

source

pub fn suppress_banners(self, suppress_banners: bool) -> Self

If true, wont print banners.

See NcFlag::SuppressBanners.

source§

impl NcOptionsBuilder

§methods (settable)

source

pub fn set_log_level(&mut self, log_level: NcLogLevel)

Sets the log level.

source

pub fn set_margins(&mut self, top: u32, right: u32, bottom: u32, left: u32)

Sets the margins.

source

pub fn set_margin_top(&mut self, top: u32)

Sets the top margin.

source

pub fn set_margin_right(&mut self, right: u32)

Sets the right margin.

source

pub fn set_margin_bottom(&mut self, bottom: u32)

Sets the bottom margin.

source

pub fn set_margin_left(&mut self, left: u32)

Sets the left margin.

source

pub fn set_drain_input(&mut self, drain: bool)

If true, Input may be freely dropped.

This ought be provided when the program does not intend to handle input. Otherwise, input can accumulate in internal buffers, eventually preventing Notcurses from processing terminal messages.

See NcFlag::DrainInput.

source

pub fn set_inhibit_set_locale(&mut self, inhibit: bool)

If true, wont call setlocale().

See NcFlag::InhibitSetLocale.

source

pub fn set_no_alternate_screen(&mut self, no_alternate: bool)

If true, wont enter alternate mode.

See NcFlag::NoAlternateScreen.

source

pub fn set_no_clear_bitmaps(&mut self, no_clear: bool)

If true, wont try to clear any preexisting bitmaps.

See NcFlag::NoClearBitmaps.

source

pub fn set_no_font_changes(&mut self, no_font_changes: bool)

If true, wont modify the font.

See NcFlag::NoFontChanges.

source

pub fn set_no_quit_sig_handlers(&mut self, no_quit: bool)

If true, wont handle SIGINT, SIGSEGV, SIGABRT nor SIGQUIT.

See NcFlag::NoQuitSigHandlers.

source

pub fn set_no_winch_sig_handler(&mut self, no_winch: bool)

If true, wont handle SIGWINCH.

See NcFlag::NoWinchSigHandler.

source

pub fn set_preserve_cursor(&mut self, preserve: bool)

If true, will initializes the CLI plane’s virtual cursor to match the physical cursor at context creation time.

See NcFlag::PreserveCursor.

source

pub fn set_scrolling(&mut self, scrolling: bool)

If true, will prepare the CLI plane in scrolling mode.

See NcFlag::Scrolling.

source

pub fn set_cli_mode(&mut self, cli_mode: bool)

A shortcut for setting the following options together: no_alternate_screen, no_clear_bitmaps, preserve_cursor & scrolling.

See NcFlag::CliMode.

source

pub fn set_suppress_banners(&mut self, suppress_banners: bool)

If true, wont print banners.

See NcFlag::SuppressBanners.

source§

impl NcOptionsBuilder

§query methods

source

pub fn get_margins(&self) -> (u32, u32, u32, u32)

Returns the (top, right, bottom, left) margins.

source

pub fn get_log_level(&self) -> NcLogLevel

Returns the log level.

source

pub fn is_drain_input(&self) -> bool

Returns true if it has the DrainInput flag set.

source

pub fn is_inhibit_set_locale(&self) -> bool

Returns true if it has the InhibitSetLocale flag set.

source

pub fn is_no_alternate_screen(&self) -> bool

Returns true if it has the NoAlternateScreen flag set.

source

pub fn is_no_clear_bitmaps(&self) -> bool

Returns true if it has the NoClearBitmaps flag set.

source

pub fn is_no_font_changes(&self) -> bool

Returns true if it has the NoFontChanges flag set.

source

pub fn is_no_quit_sig_handlers(&self) -> bool

Returns true if it has the NoQuitSigHandlers flag set.

source

pub fn is_no_winch_sig_handler(&self) -> bool

Returns true if it has the NoWinchSigHandler flag set.

source

pub fn is_preserve_cursor(&self) -> bool

Returns true if it has the PreserveCursor flag set.

source

pub fn is_scrolling(&self) -> bool

Returns true if it has the Scrolling flag set.

source

pub fn is_cli_mode(&self) -> bool

Returns true if it has the CliMode flag set.

source

pub fn is_suppress_banners(&self) -> bool

Returns true if it has the SuppressBanners flag set.

Trait Implementations§

source§

impl Clone for NcOptionsBuilder

source§

fn clone(&self) -> NcOptionsBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NcOptionsBuilder

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for NcOptionsBuilder

source§

fn default() -> NcOptionsBuilder

Returns the “default value” for a type. Read more
source§

impl From<&NcOptionsBuilder> for NcOptions

source§

fn from(builder: &NcOptionsBuilder) -> Self

Converts to this type from the input type.
source§

impl From<&mut NcOptionsBuilder> for NcOptions

source§

fn from(builder: &mut NcOptionsBuilder) -> Self

Converts to this type from the input type.
source§

impl From<&mut notcurses_options> for NcOptionsBuilder

source§

fn from(options: &mut NcOptions) -> Self

Converts to this type from the input type.
source§

impl From<&notcurses_options> for NcOptionsBuilder

source§

fn from(options: &NcOptions) -> Self

Converts to this type from the input type.
source§

impl From<NcOptionsBuilder> for NcOptions

source§

fn from(builder: NcOptionsBuilder) -> NcOptions

Converts to this type from the input type.
source§

impl From<notcurses_options> for NcOptionsBuilder

source§

fn from(options: NcOptions) -> NcOptionsBuilder

Converts to this type from the input type.
source§

impl Copy for NcOptionsBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.