libnotcurses_sys/widgets/reader/
methods.rs1use super::{NcReader, NcReaderOptions};
4use crate::{c_api::ncreader_create, error_ref_mut, NcPlane, NcResult};
5
6impl NcReaderOptions {
8 pub const fn new() -> Self {
10 Self {
11 tchannels: 0,
13 tattrword: 0,
15 flags: 0,
17 }
18 }
19}
20
21impl NcReader {
23 pub fn new<'a>(plane: &mut NcPlane) -> NcResult<&'a mut Self> {
25 Self::with_options(plane, &NcReaderOptions::new())
26 }
27
28 pub fn with_options<'a>(
30 plane: &mut NcPlane,
31 options: &NcReaderOptions,
32 ) -> NcResult<&'a mut Self> {
33 error_ref_mut![unsafe { ncreader_create(plane, options) }]
34 }
35}