Module io
Traits, helpers, and type definitions for core I/O functionality.
Modules
Structs
- BorrowedBuf A borrowed buffer of initially uninitialized elements, which is incrementally filled.
-
BorrowedCursor
A writeable view of the unfilled portion of a
BorrowedBuf. - Chain Adapter to chain together two readers.
-
Cursor
A
Cursorwraps an in-memory buffer and provides it with aSeekimplementation. - Custom A user-created allocated error.
-
CustomOwner
Effectively a
Box<Custom>withoutalloc. TheCustomholds the call to free this pointer. -
Empty
Emptyignores any data written viaWrite, and will always be empty (returning zero bytes) when read viaRead. -
Error
The error type for I/O operations of the [
Read][Read], [Write][Write], [Seek][Seek], and associated traits. -
IoSlice
A buffer type used with
Write::write_vectored. -
IoSliceMut
A buffer type used with
Read::read_vectored. - OsFunctions
- Repeat A reader which yields one byte over and over and over and over and over and...
- SimpleMessage
- Sink A writer which will move data into the void.
- Take Reader adapter which limits the bytes read from an underlying reader.
Enums
Traits
-
IoHandle
Marks that a type
Tcan have IO traits such asSeek,Write, etc. automatically implemented for handle types like [Arc][arc] as well. -
Seek
The
Seektrait provides a cursor which can be moved within a stream of bytes. -
SizeHint
Internal trait used to allow for specialization in
Read::size_hintandIterator::size_hint. - Write A trait for objects which are byte-oriented sinks.
-
WriteThroughCursor
Trait used to allow indirect implementation of
WriteforCursor<Self>. SinceCursoris not a foundational type, it is not possible to implementWriteforCursor<T>ifWriteis defined inlibcoreandTis in a downstream crate (e.g.,liballocorlibstd).
Functions
- chain
-
default_write_vectored
Default implementation of
Write::write_vectored, which is currently used inlibstdfor file system implementations of similar methods. - empty Creates a value that is always at EOF for reads, and ignores all data written.
- repeat Creates an instance of a reader that infinitely repeats one byte.
- sink Creates an instance of a writer which will successfully consume all data.
-
slice_write
Non-resizing
Write::writeimplementation for slices. Exported forCursor<Box<[u8], A>>'s implementation ofWrite. -
slice_write_all
Non-resizing
Write::write_allimplementation for slices. Exported forCursor<Box<[u8], A>>'s implementation ofWrite. -
slice_write_all_vectored
Non-resizing
Write::write_all_vectoredimplementation for slices. Exported forCursor<Box<[u8], A>>'s implementation ofWrite. -
slice_write_vectored
Non-resizing
Write::write_vectoredimplementation for slices. Exported forCursor<Box<[u8], A>>'s implementation ofWrite. -
stream_len_default
The default implementation of
Seek::stream_len. This may be desirable inlibstdwhere the default implementation is desirable, but additional work needs to be done before or after. - take
Type Aliases
- RawOsError The type of raw OS error codes.
-
Result
A specialized
Resulttype for I/O operations.
Macros
- const_error Creates a new I/O error from a known kind of error and a string literal.