• Home
  • Raw
  • Download

Lines Matching +full:write +full:- +full:error

1 //! This module is deprecated and types are exported from the top-level of the crate
6 use std::error::Error as StdError;
8 use std::io::Error as IOError;
10 pub(crate) type Result<T> = std::result::Result<T, Error>;
13 pub struct Error { struct
19 Event(nix::Error),
21 Ioctl { kind: IoctlKind, cause: nix::Error },
26 pub(crate) fn ioctl_err(kind: IoctlKind, cause: nix::Error) -> Error { in ioctl_err() argument
27 Error { in ioctl_err()
32 pub(crate) fn invalid_err(n_lines: usize, n_values: usize) -> Error { in invalid_err() argument
33 Error { in invalid_err()
38 pub(crate) fn offset_err(offset: u32) -> Error { in offset_err() argument
39 Error { in offset_err()
44 pub(crate) fn event_err(err: nix::Error) -> Error { in event_err() argument
45 Error { in event_err()
51 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
53 IoctlKind::ChipInfo => write!(f, "get chip info"), in fmt()
54 IoctlKind::LineInfo => write!(f, "get line info"), in fmt()
55 IoctlKind::LineHandle => write!(f, "get line handle"), in fmt()
56 IoctlKind::LineEvent => write!(f, "get line event "), in fmt()
57 IoctlKind::GetLine => write!(f, "get line value"), in fmt()
58 IoctlKind::SetLine => write!(f, "set line value"), in fmt()
63 impl fmt::Display for Error { implementation
64 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
66 ErrorKind::Event(err) => write!(f, "Failed to read event: {}", err), in fmt()
68 ErrorKind::Ioctl { cause, kind } => write!(f, "Ioctl to {} failed: {}", kind, cause), in fmt()
69 ErrorKind::InvalidRequest(n_lines, n_values) => write!( in fmt()
74 ErrorKind::Offset(offset) => write!(f, "Offset {} is out of range", offset), in fmt()
79 impl StdError for Error { implementation
80 fn source(&self) -> Option<&(dyn StdError + 'static)> { in source()
90 impl From<IOError> for Error { implementation
91 fn from(err: IOError) -> Self { in from()