1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use super::{NcReader, NcReaderOptions};
use crate::{error_ref_mut, ncreader_create, NcPlane, NcResult};
impl NcReaderOptions {
pub const fn new() -> Self {
Self {
tchannels: 0,
tattrword: 0,
flags: 0,
}
}
}
impl NcReader {
pub fn new<'a>(plane: &mut NcPlane) -> NcResult<&'a mut Self> {
Self::with_options(plane, NcReaderOptions::new())
}
pub fn with_options<'a>(
plane: &mut NcPlane,
options: NcReaderOptions,
) -> NcResult<&'a mut Self> {
error_ref_mut![unsafe { ncreader_create(plane, &options) }]
}
}