pub enum WriteStream {
File(File),
Udp((UdpSocket, SocketAddrV4)),
Tcp(TcpStream),
Null,
}Expand description
A write stream, wrapped in an enum to allow multiple write streams to be returned from functions while still allowing the calling function to defer the choice of stream.
This is the closed, static way to do this- the open, dynamic way would be trait objects.
Variants§
Implementations§
Source§impl WriteStream
impl WriteStream
Trait Implementations§
Source§impl Debug for WriteStream
impl Debug for WriteStream
Source§impl Default for WriteStream
impl Default for WriteStream
Source§fn default() -> WriteStream
fn default() -> WriteStream
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WriteStream
impl RefUnwindSafe for WriteStream
impl Send for WriteStream
impl Sync for WriteStream
impl Unpin for WriteStream
impl UnwindSafe for WriteStream
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