pub struct Object {
pub uid: Uid,
pub type_name: TypeName,
pub key: Key,
pub attrs: JsonMap,
pub source: Option<SourceLocation>,
}Expand description
object envelope for the ir.
Fields§
§uid: Uidstable identifier for the object.
type_name: TypeNamecanonical type for the object.
key: Keystructured key used for matching when state is missing.
attrs: JsonMapattributes payload for this object.
source: Option<SourceLocation>source location where this object was defined (not serialized).
Implementations§
Source§impl Object
impl Object
Sourcepub fn new(
uid: Uid,
type_name: TypeName,
key: Key,
attrs: JsonMap,
) -> Result<Self, ObjectError>
pub fn new( uid: Uid, type_name: TypeName, key: Key, attrs: JsonMap, ) -> Result<Self, ObjectError>
create an object with a type name.
Sourcepub fn with_source(self, source: SourceLocation) -> Self
pub fn with_source(self, source: SourceLocation) -> Self
Set the source location for this object.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Object
impl<'de> Deserialize<'de> for Object
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnsafeUnpin for Object
impl UnwindSafe for Object
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