pub struct PropertyInfo {
pub name: Atom,
pub type_id: TypeId,
pub write_type: TypeId,
pub optional: bool,
pub readonly: bool,
pub is_method: bool,
pub visibility: Visibility,
pub parent_id: Option<SymbolId>,
}Expand description
Property information for object types
Fields§
§name: Atom§type_id: TypeIdRead type (getter/lookup).
write_type: TypeIdWrite type (setter/assignment).
optional: bool§readonly: bool§is_method: bool§visibility: VisibilityVisibility modifier for nominal subtyping
parent_id: Option<SymbolId>Symbol that declared this property (for nominal identity checks)
Implementations§
Source§impl PropertyInfo
impl PropertyInfo
Sourcepub const fn new(name: Atom, type_id: TypeId) -> Self
pub const fn new(name: Atom, type_id: TypeId) -> Self
Create a property with default settings (non-optional, non-readonly, public).
Sets write_type equal to type_id.
Sourcepub const fn method(name: Atom, type_id: TypeId) -> Self
pub const fn method(name: Atom, type_id: TypeId) -> Self
Create a method property with default settings.
Sourcepub const fn opt(name: Atom, type_id: TypeId) -> Self
pub const fn opt(name: Atom, type_id: TypeId) -> Self
Create an optional property with default settings.
Sourcepub const fn readonly(name: Atom, type_id: TypeId) -> Self
pub const fn readonly(name: Atom, type_id: TypeId) -> Self
Create a readonly property with default settings.
Sourcepub fn find_in_slice(props: &[Self], name: Atom) -> Option<&Self>
pub fn find_in_slice(props: &[Self], name: Atom) -> Option<&Self>
Find a property by name in a slice of properties.
Trait Implementations§
Source§impl Clone for PropertyInfo
impl Clone for PropertyInfo
Source§fn clone(&self) -> PropertyInfo
fn clone(&self) -> PropertyInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropertyInfo
impl Debug for PropertyInfo
Source§impl Default for PropertyInfo
impl Default for PropertyInfo
Source§fn default() -> PropertyInfo
fn default() -> PropertyInfo
Returns the “default value” for a type. Read more
Source§impl Hash for PropertyInfo
impl Hash for PropertyInfo
Source§impl PartialEq for PropertyInfo
impl PartialEq for PropertyInfo
impl Eq for PropertyInfo
impl StructuralPartialEq for PropertyInfo
Auto Trait Implementations§
impl Freeze for PropertyInfo
impl RefUnwindSafe for PropertyInfo
impl Send for PropertyInfo
impl Sync for PropertyInfo
impl Unpin for PropertyInfo
impl UnsafeUnpin for PropertyInfo
impl UnwindSafe for PropertyInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.