Skip to main content

ClassMembers

Struct ClassMembers 

Source
pub struct ClassMembers<'d> {
    pub statics: Vec<Symbol<'d>>,
    pub fields: Vec<Symbol<'d>>,
    pub methods: Vec<Symbol<'d>>,
    pub ctor: Option<Symbol<'d>>,
}
Expand description

Task 2 step 2’s ClassMembers: one class’s own (non-inherited) members, split by role. statics/fields are ClassProperty members split by variable_lifetime() (8.9: a static property has one copy for the whole simulation; an ordinary, “automatic”-lifetime one is per-object); methods is every USER-declared Subroutine/MethodPrototype member that is not the constructor; ctor is the Subroutine member flagged MethodFlags::CONSTRUCTOR (8.7), if this class declares one. All four are in members()’s own declaration order — this task’s own tests rely on that order, and no later task may re-sort them.

“USER-declared” is load-bearing: slang adds 8 implicit, bodied Subroutine members to EVERY class — randomize, pre_randomize, post_randomize, get_randstate, set_randstate, srandom, rand_mode, constraint_mode (LRM 18.6/18.12–18.14’s “every class … shall have the following built-in methods”) — each flagged MethodFlags::BUILT_IN, verified live against a plain class Base; int a; function void bump(); endclass fixture (netlist_classes.rs’s own regression: class_sym.members() for that class yields bump PLUS all 8 of these, not bump alone). classify_members excludes them from methods — this plan’s own header is explicit that randomize()/constraint solving (18.1–18.12/18.16–18.17) is the sibling constraints plan’s job, not this one’s, and dumping these 8 into methods would make Task 7’s vtable-slot assignment try to mangle/lower them as if they were ordinary user methods.

Fields§

§statics: Vec<Symbol<'d>>§fields: Vec<Symbol<'d>>§methods: Vec<Symbol<'d>>§ctor: Option<Symbol<'d>>

Trait Implementations§

Source§

impl<'d> Clone for ClassMembers<'d>

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<'d> Debug for ClassMembers<'d>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for ClassMembers<'d>

§

impl<'d> !UnwindSafe for ClassMembers<'d>

§

impl<'d> Freeze for ClassMembers<'d>

§

impl<'d> Send for ClassMembers<'d>

§

impl<'d> Sync for ClassMembers<'d>

§

impl<'d> Unpin for ClassMembers<'d>

§

impl<'d> UnsafeUnpin for ClassMembers<'d>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V