Struct notcurses_options

Source
#[repr(C)]
pub struct notcurses_options { pub termtype: *const c_char, pub loglevel: ncloglevel_e, pub margin_t: c_uint, pub margin_r: c_uint, pub margin_b: c_uint, pub margin_l: c_uint, pub flags: u64, }
Expand description

Configuration for notcurses_init().

Fields§

§termtype: *const c_char

The name of the terminfo database entry describing this terminal. If NULL, the environment variable TERM is used. Failure to open the terminal definition will result in failure to initialize notcurses.

§loglevel: ncloglevel_e

Progressively higher log levels result in more logging to stderr. By default, nothing is printed to stderr once fullscreen service begins.

§margin_t: c_uint

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_r: c_uint

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_b: c_uint

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_l: c_uint

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§flags: u64

General flags; see NCOPTION_*. This is expressed as a bitfield so that future options can be added without reshaping the struct. Undefined bits must be set to 0.

Implementations§

Source§

impl notcurses_options

§constructors

Source

pub fn builder() -> NcOptionsBuilder

Returns a default Nc options builder.

Source

pub fn to_builder(&self) -> NcOptionsBuilder

Returns a builder object from the current Nc options.

Source

pub fn new() -> Self

New NcOptions.

Source

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

New NcOptions, with margins.

Source

pub fn with_flags(flags: NcFlag) -> Self

New NcOptions, with flags.

Source

pub fn with_all_options( loglevel: NcLogLevel, trbl_margins: Option<(u32, u32, u32, u32)>, flags: NcFlag, ) -> NcOptions

New NcOptions, with flags

Source§

impl notcurses_options

§methods

Source

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

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

Source

pub fn 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 Debug for notcurses_options

Source§

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

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

impl Default for notcurses_options

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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<notcurses_options> for NcOptionsBuilder

Source§

fn from(options: NcOptions) -> NcOptionsBuilder

Converts to this type from the input type.
Source§

impl Hash for notcurses_options

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for notcurses_options

Source§

fn cmp(&self, other: &notcurses_options) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for notcurses_options

Source§

fn eq(&self, other: &notcurses_options) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for notcurses_options

Source§

fn partial_cmp(&self, other: &notcurses_options) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for notcurses_options

Source§

impl StructuralPartialEq for notcurses_options

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.