Lines Matching full:length
33 /// the read length and the next read will start from there. This helps prevent accidentally reading
107 length: usize, field
111 /// Constructs a user slice from a raw pointer and a length in bytes.
113 /// Constructing a [`UserSlice`] performs no checks on the provided address and length, it can
123 pub fn new(ptr: UserPtr, length: usize) -> Self { in new()
124 UserSlice { ptr, length } in new()
138 length: self.length, in reader()
146 length: self.length, in writer()
157 length: self.length, in reader_writer()
161 length: self.length, in reader_writer()
172 length: usize, field
178 /// Returns an error if skipping more than the length of the buffer.
180 // Update `self.length` first since that's the fallible part of this operation. in skip()
181 self.length = self.length.checked_sub(num_skip).ok_or(EFAULT)?; in skip()
195 length: self.length, in clone_reader()
203 self.length in len()
208 self.length == 0 in is_empty()
224 if len > self.length { in read_raw()
227 // SAFETY: `out_ptr` points into a mutable slice of length `len`, so we may write in read_raw()
234 self.length -= len; in read_raw()
255 if len > self.length { in read()
263 // length is a compile-time constant. in read()
275 self.length -= len; in read()
285 let len = self.length; in read_all()
304 length: usize, field
312 self.length in len()
317 self.length == 0 in is_empty()
328 if len > self.length { in write_slice()
331 // SAFETY: `data_ptr` points into an immutable slice of length `len`, so we may read in write_slice()
338 self.length -= len; in write_slice()
349 if len > self.length { in write()
356 // kernel pointer. This mirrors the logic on the C side that skips the check when the length in write()
369 self.length -= len; in write()