pub struct UserBuffer {
    pub buffers: Vec<&'static mut [u8]>,
    pub len: usize,
}
Expand description

A buffer in user space. Kernel space code may use this struct to copy to/ read from user space. This struct is meaningless in case that the kernel page is present in the user side MemorySet.

Fields

buffers: Vec<&'static mut [u8]>

The segmented array, or, a “vector of vectors”.

Design Information

In Rust, reference lifetime is a must for this template. The lifetime of buffers is static because the buffer ‘USES A’ instead of ‘HAS A’

len: usize

The total size of the Userbuffer.

Implementations

Write to self starting at offset, and return written bytes. This funtion will try to write as much as possible data in the limit of self.len() and src.len(). It guarantees that won’t read/write out of bound.

Trait Implementations

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.