pub struct ScriptOut<W: Write>(/* private fields */);Expand description
Newtype over the real stdout handle. Constructed once in main and handed
only to emission call sites, so writing script bytes to the wrong stream is
unrepresentable.
Implementations§
Source§impl<W: Write> ScriptOut<W>
impl<W: Write> ScriptOut<W>
Sourcepub fn emit_script(&mut self, cmds: &[String]) -> Result<()>
pub fn emit_script(&mut self, cmds: &[String]) -> Result<()>
Port of emit_script (try.rb:1395-1409): warning comment first,
commands chained && \ with 2-space continuation indent, final
newline, no trailing &&.
§Errors
Propagates I/O errors from the underlying writer.
Auto Trait Implementations§
impl<W> Freeze for ScriptOut<W>where
W: Freeze,
impl<W> RefUnwindSafe for ScriptOut<W>where
W: RefUnwindSafe,
impl<W> Send for ScriptOut<W>where
W: Send,
impl<W> Sync for ScriptOut<W>where
W: Sync,
impl<W> Unpin for ScriptOut<W>where
W: Unpin,
impl<W> UnsafeUnpin for ScriptOut<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for ScriptOut<W>where
W: UnwindSafe,
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