Debian Codegraph @

debian/rust-vendor/xattr/src/sys/unsupported.rs

raw
1 use std::ffi::{OsStr, OsString};
2 use std::io;
3 use std::os::unix::io::BorrowedFd;
4 use std::path::Path;
5
6 use crate::UnsupportedPlatformError;
7
8 pub const ENOATTR: i32 = 0;
9 pub const ERANGE: i32 = 0;
10
11 /// An iterator over a set of extended attributes names.
12 #[derive(Clone, Default)]
13 pub struct XAttrs;
14
15 impl Iterator for XAttrs {
16 type Item = OsString;
17 fn next(&mut self) -> Option<OsString> {
18 None
19 }
20
21 fn size_hint(&self) -> (usize, Option<usize>) {
22 (0, Some(0))
23 }
24 }
25
26 pub fn get_fd(_: BorrowedFd<'_>, _: &OsStr) -> io::Result<Vec<u8>> {
27 Err(io::Error::new(
28 io::ErrorKind::Unsupported,
29 UnsupportedPlatformError,
30 ))
31 }
32
33 pub fn set_fd(_: BorrowedFd<'_>, _: &OsStr, _: &[u8]) -> io::Result<()> {
34 Err(io::Error::new(
35 io::ErrorKind::Unsupported,
36 UnsupportedPlatformError,
37 ))
38 }
39
40 pub fn remove_fd(_: BorrowedFd<'_>, _: &OsStr) -> io::Result<()> {
41 Err(io::Error::new(
42 io::ErrorKind::Unsupported,
43 UnsupportedPlatformError,
44 ))
45 }
46
47 pub fn list_fd(_: BorrowedFd<'_>) -> io::Result<XAttrs> {
48 Err(io::Error::new(
49 io::ErrorKind::Unsupported,
50 UnsupportedPlatformError,
51 ))
52 }
53
54 pub fn get_path(_: &Path, _: &OsStr, _: bool) -> io::Result<Vec<u8>> {
55 Err(io::Error::new(
56 io::ErrorKind::Unsupported,
57 UnsupportedPlatformError,
58 ))
59 }
60
61 pub fn set_path(_: &Path, _: &OsStr, _: &[u8], _: bool) -> io::Result<()> {
62 Err(io::Error::new(
63 io::ErrorKind::Unsupported,
64 UnsupportedPlatformError,
65 ))
66 }
67
68 pub fn remove_path(_: &Path, _: &OsStr, _: bool) -> io::Result<()> {
69 Err(io::Error::new(
70 io::ErrorKind::Unsupported,
71 UnsupportedPlatformError,
72 ))
73 }
74
75 pub fn list_path(_: &Path, _: bool) -> io::Result<XAttrs> {
76 Err(io::Error::new(
77 io::ErrorKind::Unsupported,
78 UnsupportedPlatformError,
79 ))
80 }