ncurseswwin/gen/
hasinfunctions.rs1#![allow(deprecated)]
24
25use std::convert::TryFrom;
26use ncursesw::{ChtypeChar, ChtypeString, ComplexChar, ComplexString, WideString, WINDOW};
27use crate::{NCurseswWinError, gen::HasHandle};
28
29pub trait HasInFunctions: HasHandle<WINDOW> {
31 fn inchnstr(&self, length: u16) -> result!(ChtypeString) {
32 Ok(ncursesw::winchnstr(self._handle(), i32::try_from(length)?)?)
33 }
34
35 fn inch(&self) -> ChtypeChar {
36 ncursesw::winch(self._handle())
37 }
38
39 #[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use inchnstr() instead")]
40 fn inchstr(&self) -> result!(ChtypeString) {
41 Ok(ncursesw::winchstr(self._handle())?)
42 }
43
44 fn innstr(&self, length: u16) -> result!(String) {
45 Ok(ncursesw::winnstr(self._handle(), i32::try_from(length)?)?)
46 }
47
48 fn innwstr(&self, length: u16) -> result!(WideString) {
49 Ok(ncursesw::winnwstr(self._handle(), i32::try_from(length)?)?)
50 }
51
52 #[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use innstr() instead")]
53 fn instr(&self) -> result!(String) {
54 Ok(ncursesw::winstr(self._handle())?)
55 }
56
57 fn in_wchnstr(&self, length: u16) -> result!(ComplexString) {
58 Ok(ncursesw::win_wchnstr(self._handle(), i32::try_from(length)?)?)
59 }
60
61 fn in_wch(&self) -> result!(ComplexChar) {
62 Ok(ncursesw::win_wch(self._handle())?)
63 }
64
65 #[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use in_wchnstr() instead")]
66 fn in_wchstr(&self) -> result!(ComplexString) {
67 Ok(ncursesw::win_wchstr(self._handle())?)
68 }
69
70 #[deprecated(since = "0.1.1", note = "underlying native function can cause issues. Use innwstr() instead")]
71 fn inwstr(&self) -> result!(WideString) {
72 Ok(ncursesw::winwstr(self._handle())?)
73 }
74}