Sign in

    moonbitlang/async/raw_fd does not have a README file

    RawFd

    pub struct RawFd {
    fd : Int
    // private fields
    }

    A wrapper around a raw file descriptor that can be used to perform asynchronous IO on the raw file descriptor. This is useful for binding special file descriptors that are not natively supported by moonbitlang/async.

    RawFd::RawFd

    #alias(new, deprecated="`new` is deprecated, use `RawFd` instead")
    async fn RawFd::RawFd(fd : Int) -> RawFd

    Create a new RawFd object from the underlying file descriptor. The ownership of the file descriptor will be transferred to this function, so the file descriptor must not be used or closed directly later, even if creation of RawFd object failed.

    RawFd::close

    fn RawFd::close(self : RawFd) -> Unit

    RawFd::read

    async fn RawFd::read(self : RawFd, buf : FixedArray[Byte], offset? : Int, max_len? : Int) -> Int

    Perform a single read/ReadFile system call asynchronously on a raw file descriptor object. Data will be read into buf[offset:offset+max_len]. The number of bytes actually read will be returned, note that the number may be smaller than max_len. A zero return value indicates EOF.

    RawFd::write

    async fn RawFd::write(self : RawFd, buf : Bytes, offset? : Int, len? : Int) -> Int

    Perform a single write/WriteFile system call asynchronously on a raw file descriptor object. Data to write come from buf[offset:offset+len]. The number of bytes actually written will be returned, note that the number may be smaller than len.

    RawFdStream

    pub struct RawFdStream {
    fd : Int
    // private fields
    }

    A wrapper around a raw file descriptor that can be used to perform asynchronous stream-based IO on the raw file descriptor via the @io.Reader/@io.Writer interface. This is useful for binding special file descriptors that are not natively supported by moonbitlang/async.

    RawFdStream::RawFdStream

    async fn RawFdStream::RawFdStream(fd : Int) -> RawFdStream

    Create a new RawFdStream object from the underlying file descriptor. The ownership of the file descriptor will be transferred to this function, so the file descriptor must not be used or closed directly later, even if creation of RawFdStream object failed.

    RawFdStream::close

    fn RawFdStream::close(self : RawFdStream) -> Unit

    RawFdStream::drop

    async fn RawFdStream::drop(self : RawFdStream, len : Int) -> Int

    RawFdStream::read

    async fn RawFdStream::read(self : RawFdStream, dst : FixedArray[Byte], offset? : Int, max_len? : Int) -> Int

    RawFdStream::read_all

    RawFdStream::read_exactly

    async fn RawFdStream::read_exactly(self : RawFdStream, len : Int) -> Bytes

    RawFdStream::read_some

    async fn RawFdStream::read_some(self : RawFdStream, max_len? : Int) -> Bytes?

    RawFdStream::read_until

    async fn RawFdStream::read_until(self : RawFdStream, sep : StringView) -> String?

    RawFdStream::write

    async fn RawFdStream::write(self : RawFdStream, data : &
    Data
    ) -> Unit

    RawFdStream::write_once

    async fn RawFdStream::write_once(self : RawFdStream, buf : Bytes, offset~ : Int, len~ : Int) -> Int

    RawFdStream::write_reader

    async fn RawFdStream::write_reader(self : RawFdStream, reader : &
    Reader
    ) -> Unit

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io