|
11 | 11 | //! Define the `ByteValued` trait to mark that it is safe to instantiate the struct with random |
12 | 12 | //! data. |
13 | 13 |
|
14 | | -use std::io::{Read, Write}; |
15 | 14 | use std::mem::{size_of, MaybeUninit}; |
16 | 15 | use std::result::Result; |
17 | 16 | use std::slice::{from_raw_parts, from_raw_parts_mut}; |
@@ -277,72 +276,6 @@ pub trait Bytes<A> { |
277 | 276 | self.read_slice(result.as_mut_slice(), addr).map(|_| result) |
278 | 277 | } |
279 | 278 |
|
280 | | - /// Reads up to `count` bytes from an object and writes them into the container at `addr`. |
281 | | - /// |
282 | | - /// Returns the number of bytes written into the container. |
283 | | - /// |
284 | | - /// # Arguments |
285 | | - /// * `addr` - Begin writing at this address. |
286 | | - /// * `src` - Copy from `src` into the container. |
287 | | - /// * `count` - Copy `count` bytes from `src` into the container. |
288 | | - #[deprecated( |
289 | | - note = "Use `.read_volatile_from` or the functions of the `ReadVolatile` trait instead" |
290 | | - )] |
291 | | - fn read_from<F>(&self, addr: A, src: &mut F, count: usize) -> Result<usize, Self::E> |
292 | | - where |
293 | | - F: Read; |
294 | | - |
295 | | - /// Reads exactly `count` bytes from an object and writes them into the container at `addr`. |
296 | | - /// |
297 | | - /// # Errors |
298 | | - /// |
299 | | - /// Returns an error if `count` bytes couldn't have been copied from `src` to the container. |
300 | | - /// Part of the data may have been copied nevertheless. |
301 | | - /// |
302 | | - /// # Arguments |
303 | | - /// * `addr` - Begin writing at this address. |
304 | | - /// * `src` - Copy from `src` into the container. |
305 | | - /// * `count` - Copy exactly `count` bytes from `src` into the container. |
306 | | - #[deprecated( |
307 | | - note = "Use `.read_exact_volatile_from` or the functions of the `ReadVolatile` trait instead" |
308 | | - )] |
309 | | - fn read_exact_from<F>(&self, addr: A, src: &mut F, count: usize) -> Result<(), Self::E> |
310 | | - where |
311 | | - F: Read; |
312 | | - |
313 | | - /// Reads up to `count` bytes from the container at `addr` and writes them it into an object. |
314 | | - /// |
315 | | - /// Returns the number of bytes written into the object. |
316 | | - /// |
317 | | - /// # Arguments |
318 | | - /// * `addr` - Begin reading from this address. |
319 | | - /// * `dst` - Copy from the container to `dst`. |
320 | | - /// * `count` - Copy `count` bytes from the container to `dst`. |
321 | | - #[deprecated( |
322 | | - note = "Use `.write_volatile_to` or the functions of the `WriteVolatile` trait instead" |
323 | | - )] |
324 | | - fn write_to<F>(&self, addr: A, dst: &mut F, count: usize) -> Result<usize, Self::E> |
325 | | - where |
326 | | - F: Write; |
327 | | - |
328 | | - /// Reads exactly `count` bytes from the container at `addr` and writes them into an object. |
329 | | - /// |
330 | | - /// # Errors |
331 | | - /// |
332 | | - /// Returns an error if `count` bytes couldn't have been copied from the container to `dst`. |
333 | | - /// Part of the data may have been copied nevertheless. |
334 | | - /// |
335 | | - /// # Arguments |
336 | | - /// * `addr` - Begin reading from this address. |
337 | | - /// * `dst` - Copy from the container to `dst`. |
338 | | - /// * `count` - Copy exactly `count` bytes from the container to `dst`. |
339 | | - #[deprecated( |
340 | | - note = "Use `.write_all_volatile_to` or the functions of the `WriteVolatile` trait instead" |
341 | | - )] |
342 | | - fn write_all_to<F>(&self, addr: A, dst: &mut F, count: usize) -> Result<(), Self::E> |
343 | | - where |
344 | | - F: Write; |
345 | | - |
346 | 279 | /// Atomically store a value at the specified address. |
347 | 280 | fn store<T: AtomicAccess>(&self, val: T, addr: A, order: Ordering) -> Result<(), Self::E>; |
348 | 281 |
|
@@ -481,34 +414,6 @@ pub(crate) mod tests { |
481 | 414 | Ok(()) |
482 | 415 | } |
483 | 416 |
|
484 | | - fn read_from<F>(&self, _: usize, _: &mut F, _: usize) -> Result<usize, Self::E> |
485 | | - where |
486 | | - F: Read, |
487 | | - { |
488 | | - unimplemented!() |
489 | | - } |
490 | | - |
491 | | - fn read_exact_from<F>(&self, _: usize, _: &mut F, _: usize) -> Result<(), Self::E> |
492 | | - where |
493 | | - F: Read, |
494 | | - { |
495 | | - unimplemented!() |
496 | | - } |
497 | | - |
498 | | - fn write_to<F>(&self, _: usize, _: &mut F, _: usize) -> Result<usize, Self::E> |
499 | | - where |
500 | | - F: Write, |
501 | | - { |
502 | | - unimplemented!() |
503 | | - } |
504 | | - |
505 | | - fn write_all_to<F>(&self, _: usize, _: &mut F, _: usize) -> Result<(), Self::E> |
506 | | - where |
507 | | - F: Write, |
508 | | - { |
509 | | - unimplemented!() |
510 | | - } |
511 | | - |
512 | 417 | fn store<T: AtomicAccess>( |
513 | 418 | &self, |
514 | 419 | _val: T, |
|
0 commit comments