Skip to main content

Handle

Enum Handle 

Source
pub enum Handle {
    DHeader,
    EmHeader,
    Pid,
    TryConstruct,
    ReaderMark,
    PidRead,
    EmHeaderRead,
}
Expand description

A small value of the runtime’s that the generated code declares.

A header is opened before the value it frames and closed after it, and the close needs to know where the open wrote. Each runtime keeps that in a small value of its own — zdw_dheader in C, DHeader in Java — and the walk holds one in a local without knowing what it is.

Naming these in the walk was the last thing C’s spelling reached into: a Java backend that inherited zdw_dheader as a type name would generate source no compiler has a type for.

The reading direction adds four, and they were the leak the C++ reader found: the walk spelled zdw_try_construct, zdw_reader_mark, zdw_pid_read and zdw_emheader_read into CodecTarget::named directly, which is C’s namespace written into what is supposed to be language-neutral. They went unnoticed because the C column was the only one that generated a reader.

Variants§

§

DHeader

What CodecTarget::runtime’s write_dheader returns.

§

EmHeader

What write_emheader returns.

§

Pid

What write_pid and write_pid_extended return.

§

TryConstruct

The behaviour §7.2.2.7 attaches to a position, as the reader’s extra parameter takes it.

zdw_try_construct in C, TryConstruct in Java and C++. A parameter rather than something the runtime hands back, and here rather than beside Constant because the walk needs the type to declare the parameter with; the three values it takes are Constant::TryConstruct*. A walk that wrote C’s spelling would name a type javac has never seen.

§

ReaderMark

What reader_save returns and reader_restore takes.

§

PidRead

What read_pid and read_pid_as return.

§

EmHeaderRead

What read_emheader returns.

Trait Implementations§

Source§

impl Clone for Handle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Handle

Source§

impl Debug for Handle

Source§

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

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

impl Eq for Handle

Source§

impl Hash for Handle

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Handle

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Handle

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.