#[repr(C)]pub struct StatFS {
pub ftype: u64,
pub bsize: u64,
pub blocks: u64,
pub bfree: u64,
pub bavail: u64,
pub files: u64,
pub ffree: u64,
pub fsid: u64,
pub namelen: u64,
}
Expand description
文件系统状态结构体,用于 statfs 系统调用返回信息
Fields§
§ftype: u64
文件系统的类型(magic number,用于标识如 ext4, tmpfs 等)
bsize: u64
最优传输块大小(用于文件系统的 I/O 操作优化)
blocks: u64
文件系统中数据块的总数量
bfree: u64
当前空闲的数据块数量(包括超级用户可用)
bavail: u64
普通用户可用的数据块数量(不包括超级用户保留)
files: u64
文件结点(i-node)总数,表示最多可创建的文件数量
ffree: u64
可用的文件结点数
fsid: u64
文件系统标识符(通常是一个唯一的 ID,用于区分不同的文件系统挂载点)
namelen: u64
支持的最大文件名长度(单位:字节)
Trait Implementations§
Source§impl FromBytes for StatFSwhere
u64: FromBytes,
impl FromBytes for StatFSwhere
u64: FromBytes,
Source§fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>where
Self: Sized,
fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>where
Self: Sized,
Source§fn read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>where
Self: Sized,
fn read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>where
Self: Sized,
Source§fn read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), SizeError<&[u8], Self>>where
Self: Sized,
fn read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), SizeError<&[u8], Self>>where
Self: Sized,
Source§impl FromZeros for StatFSwhere
u64: FromZeros,
impl FromZeros for StatFSwhere
u64: FromZeros,
Source§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere
Self: Sized,
Creates an instance of
Self
from zeroed bytes. Read moreSource§fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
Creates a
Box<Self>
from zeroed bytes. Read moreSource§fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
Creates a
Vec<Self>
from zeroed bytes. Read moreSource§fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
Extends a
Vec<Self>
by pushing additional
new items onto the end of
the vector. The new items are initialized with zeros.Source§fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
Inserts
additional
new items into Vec<Self>
at position
. The new
items are initialized with zeros. Read moreSource§impl IntoBytes for StatFSwhere
u64: IntoBytes,
(): PaddingFree<Self, { _ }>,
impl IntoBytes for StatFSwhere
u64: IntoBytes,
(): PaddingFree<Self, { _ }>,
Source§fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§fn write_to_prefix(
&self,
dst: &mut [u8],
) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to_prefix(
&self,
dst: &mut [u8],
) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl TryFromBytes for StatFSwhere
u64: TryFromBytes,
impl TryFromBytes for StatFSwhere
u64: TryFromBytes,
Source§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Immutable for StatFSwhere
u64: Immutable,
Auto Trait Implementations§
impl Freeze for StatFS
impl RefUnwindSafe for StatFS
impl Send for StatFS
impl Sync for StatFS
impl Unpin for StatFS
impl UnwindSafe for StatFS
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)