Struct rb_io_t

Source
#[repr(C)]
pub struct rb_io_t {
Show 21 fields pub self_: VALUE, pub stdio_file: *mut FILE, pub fd: c_int, pub mode: c_int, pub pid: pid_t, pub lineno: c_int, pub pathv: VALUE, pub finalize: Option<unsafe extern "C" fn(arg1: *mut rb_io_t, arg2: c_int)>, pub wbuf: rb_io_buffer_t, pub rbuf: rb_io_buffer_t, pub tied_io_for_writing: VALUE, pub encs: rb_io_enc_t, pub readconv: *mut rb_econv_t, pub cbuf: rb_io_buffer_t, pub writeconv: *mut rb_econv_t, pub writeconv_asciicompat: VALUE, pub writeconv_initialized: c_int, pub writeconv_pre_ecflags: c_int, pub writeconv_pre_ecopts: VALUE, pub write_lock: VALUE, pub timeout: VALUE,
}
Expand description

§Ruby’s IO, metadata and buffers.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

Fields§

§self_: VALUE

§The IO’s Ruby level counterpart.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§stdio_file: *mut FILE

§stdio ptr for read/write, if available.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§fd: c_int

§file descriptor.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§mode: c_int

§mode flags: FMODE_XXXs

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§pid: pid_t

§child’s pid (for pipes)

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§lineno: c_int

§number of lines read

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§pathv: VALUE

§pathname for file

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§finalize: Option<unsafe extern "C" fn(arg1: *mut rb_io_t, arg2: c_int)>

§finalize proc

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§wbuf: rb_io_buffer_t

§Write buffer.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§rbuf: rb_io_buffer_t

§(Byte) read buffer. Note also that there is a field called ::rb_io_t::cbuf, which also concerns read IO.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§tied_io_for_writing: VALUE

Duplex IO object, if set.

§@see rb_io_set_write_io

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§encs: rb_io_enc_t

§< Decomposed encoding flags.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§readconv: *mut rb_econv_t

§Encoding converter used when reading from this IO.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§cbuf: rb_io_buffer_t

§rb_io_ungetc destination. This buffer is read before checking ::rb_io_t::rbuf

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§writeconv: *mut rb_econv_t

§Encoding converter used when writing to this IO.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§writeconv_asciicompat: VALUE

§This is, when set, an instance of ::rb_cString which holds the “common” encoding. Write conversion can convert strings twice… In case conversion from encoding X to encoding Y does not exist, Ruby finds an encoding Z that bridges the two, so that X to Z to Y conversion happens.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§writeconv_initialized: c_int

§Whether ::rb_io_t::writeconv is already set up.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§writeconv_pre_ecflags: c_int

§Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before initialising ::rb_io_t::writeconv.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§writeconv_pre_ecopts: VALUE

§Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising ::rb_io_t::writeconv.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§write_lock: VALUE

This is a Ruby level mutex. It avoids multiple threads to write to an IO at once; helps for instance rb_io_puts to ensure newlines right next to its arguments.

§This of course doesn’t help inter-process IO interleaves, though.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

§timeout: VALUE

§The timeout associated with this IO when performing blocking operations.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3

Trait Implementations§

Source§

impl Clone for rb_io_t

Source§

fn clone(&self) -> rb_io_t

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for rb_io_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for rb_io_t

Source§

fn eq(&self, other: &rb_io_t) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for rb_io_t

Source§

impl Eq for rb_io_t

Source§

impl StructuralPartialEq for rb_io_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.