[−][src]Struct rttrust::device::CharDevice
Providing regular device operation for non-block device
Implementations
impl<'a> CharDevice<'a>
[src]
pub fn new(device: &'a mut Device) -> Result<Self>
[src]
Create a CharDevice for reading and writing non-block device.
If device
is DeviceType::RT_Device_Class_Block,
the method will return RtError::NoSys
.
Trait Implementations
impl<'_> Read for CharDevice<'_>
[src]
type ReadError = RtError
Value of this type is returned when read()
fails. Read more
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_exact(
&mut self,
buf: &mut [u8]
) -> Result<(), ReadExactError<Self::ReadError>>
[src]
&mut self,
buf: &mut [u8]
) -> Result<(), ReadExactError<Self::ReadError>>
fn available_bytes(&self, _at_least: usize) -> bool
[src]
fn chain<R>(self, other: R) -> Chain<Self, R> where
R: Read,
[src]
R: Read,
fn read_to_end<T>(
&mut self,
container: &mut T
) -> Result<usize, ExtendError<Self::ReadError, <T as ExtendFromReaderSlow>::ExtendError>> where
Self: ReadOverwrite,
T: ExtendFromReader,
[src]
&mut self,
container: &mut T
) -> Result<usize, ExtendError<Self::ReadError, <T as ExtendFromReaderSlow>::ExtendError>> where
Self: ReadOverwrite,
T: ExtendFromReader,
fn by_ref(&mut self) -> &mut Self
[src]
impl<'_> Seek for CharDevice<'_>
[src]
impl<'_> Write for CharDevice<'_>
[src]
type WriteError = RtError
Value of this type is returned when write()
fails. Read more
type FlushError = RtError
Value of this type is returned when flush()
fails.
In case of low-level writers flush often does nothing and therefore doesn't return error,
so this type might be Void. Read more
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn size_hint(&mut self, _bytes: usize)
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::WriteError>
[src]
fn uses_size_hint(&self) -> bool
[src]
impl<'_> WriteFmt for CharDevice<'_>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<R> ReadExt for R where
R: Read + ?Sized,
[src]
R: Read + ?Sized,
fn read_ext(
&'a mut self,
buf: &'b mut [u8]
) -> Result<ReadResult<'b>, <R as Read>::ReadError>
[src]
&'a mut self,
buf: &'b mut [u8]
) -> Result<ReadResult<'b>, <R as Read>::ReadError>
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,