pub enum SendableDataSource {
File(File),
Memory(SharedMem),
Inline(Vec<u8>),
}
Expand description
A source of data can be sent to other processes over a MessageChannel
or similar
mechanism. It may consist of a file handle, shared memory, or inline data.
Variants§
Implementations§
Source§impl SendableDataSource
impl SendableDataSource
Sourcepub fn to_read(self) -> Result<SendableDataSourceReader>
pub fn to_read(self) -> Result<SendableDataSourceReader>
Converts the SendableDataSource
into an appropriate std::io::Read
implementation.
Sourcepub fn to_bytes(self) -> Result<SendableDataSourceBytes>
pub fn to_bytes(self) -> Result<SendableDataSourceBytes>
Converts the SendableDataSource
into a in-memory byte array.
If the data source is a file, this will read the entirety of it to memory at once. Use to_read
if you need only streaming access to the data.
Trait Implementations§
Source§impl Debug for SendableDataSource
impl Debug for SendableDataSource
Source§impl<'de> Deserialize<'de> for SendableDataSource
impl<'de> Deserialize<'de> for SendableDataSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<File> for SendableDataSource
impl From<File> for SendableDataSource
Auto Trait Implementations§
impl Freeze for SendableDataSource
impl RefUnwindSafe for SendableDataSource
impl Send for SendableDataSource
impl Sync for SendableDataSource
impl Unpin for SendableDataSource
impl UnwindSafe for SendableDataSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more