Search results

There are no results.

std.io.Write

Write

A type data can be written to (e.g. a File).

Required methods

flush

Show source code
Hide source code
fn pub mut flush -> Result[Nil, Error]
fn pub mut flush -> Result[Nil, Error]

Flushes any pending writes.

write_bytes

Show source code
Hide source code
fn pub mut write_bytes(bytes: ref ByteArray) -> Result[Nil, Error]
fn pub mut write_bytes(bytes: ref ByteArray) -> Result[Nil, Error]

Writes the entirety of bytes to the underlying stream.

Types implementing this method must guarantee that upon returning from this method, either all of the data is written and a Ok(Nil) is returned, or an Error(Error) is returned.

write_string

Show source code
Hide source code
fn pub mut write_string(string: String) -> Result[Nil, Error]
fn pub mut write_string(string: String) -> Result[Nil, Error]

Writes the entirety of string to the underlying stream.

See Write.write_bytes for more details.

Default methods

print

Show source code
Hide source code
fn pub mut print(string: String) -> Result[Nil, Error] {
  write_string(string).then(fn (_) { write_string('\n') })
}
fn pub mut print(string: String) -> Result[Nil, Error]

Writes the entirety of string to the underlying stream, followed by writing a Unix newline to the stream.

Implementations

std.fs.file.

ReadWriteFile

impl Write for ReadWriteFile
std.fs.file.

WriteOnlyFile

impl Write for WriteOnlyFile
std.net.socket.

Socket

impl Write for Socket
std.net.socket.

TcpClient

impl Write for TcpClient
std.net.socket.

UdpSocket

impl Write for UdpSocket
std.net.socket.

UnixClient

impl Write for UnixClient
std.net.socket.

UnixDatagram

impl Write for UnixDatagram
std.net.socket.

UnixSocket

impl Write for UnixSocket
std.stdio.

STDERR

impl Write for STDERR
std.stdio.

STDOUT

impl Write for STDOUT
std.sys.

Stdin

impl Write for Stdin