Skip to main content

IntoSource

Trait IntoSource 

Source
pub trait IntoSource {
    // Required method
    fn into_source(self) -> Result<Source, Error>;
}
Expand description

One input a read operation can acquire.

A string or path names a file or directory to open. A byte buffer is content already in memory, named MEMORY_SOURCE_NAME. A Source passes through, so a source carrying named buffers or a widened acquisition root reaches the same operations as a file name.

A caller’s own input type reaches the same operations by implementing it. It carries this one method and gains no further required method: options belong to the operation, not to the input.

Required Methods§

Source

fn into_source(self) -> Result<Source, Error>

Acquire the input.

§Errors

The file or directory cannot be acquired, or the in-memory name is invalid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoSource for &Path

Source§

impl IntoSource for &PathBuf

Source§

impl IntoSource for &String

Source§

impl IntoSource for &[u8]

Source§

impl IntoSource for &str

Source§

impl IntoSource for Arc<[u8]>

Source§

impl IntoSource for PathBuf

Source§

impl IntoSource for String

Source§

impl IntoSource for Vec<u8>

Source§

impl<const N: usize> IntoSource for &[u8; N]

Implementors§