Struct pschema_rs::shape::shex::ShapeReference
source · pub struct ShapeReference { /* private fields */ }Expand description
The ShapeReference struct contains a label, property ID, and a reference to a
Shape object.
Properties:
label: The label is a u8 (unsigned 8-bit integer) that represents a unique identifier for the ShapeReference object.property_id:property_idis au32(unsigned 32-bit integer) that represents the unique identifier of a property associated with theShapeReference. This identifier can be used to retrieve additional information about the property from a database or other data source.reference:referenceis a field of typeShapethat is contained within theShapeReferencestruct. It is likely a reference to another instance of theShapestruct.
Implementations§
source§impl ShapeReference
impl ShapeReference
The above code is implementing a method for a struct called ShapeReference.
The new method takes in a label of type u8, a property_id of type u32,
and a dst of type Shape, and returns a new instance of ShapeReference with
those values. The get_reference method takes in self and returns the
reference field of the ShapeReference instance.
sourcepub fn new(label: u8, property_id: u32, dst: Shape) -> Self
pub fn new(label: u8, property_id: u32, dst: Shape) -> Self
This is a constructor function that creates a new instance of a struct with a label, property ID, and reference to a shape.
Arguments:
label: The label is a u8 value that represents the type of the property. For example, a label of 0 could represent a string property, while a label of 1 could represent a numeric property.property_id: Theproperty_idparameter is a 32-bit unsigned integer that represents the ID of a property associated with a shape. It is used as a unique identifier for the property.dst:dstis a parameter of typeShapewhich represents the destination shape of a relationship. It is used in the context of creating a new relationship instance with the givenlabel,property_id, anddst.
Returns:
The new function is returning an instance of the Self struct, which contains
the label, property_id, and reference fields.
sourcepub fn get_reference(self) -> Shape
pub fn get_reference(self) -> Shape
This Rust function returns a Shape reference.
Returns:
A Shape object is being returned.
Trait Implementations§
source§impl Clone for ShapeReference
impl Clone for ShapeReference
source§fn clone(&self) -> ShapeReference
fn clone(&self) -> ShapeReference
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ShapeReference
impl Debug for ShapeReference
source§impl From<ShapeReference> for Shape
impl From<ShapeReference> for Shape
The above code is implementing the From trait for the ShapeReference struct,
which allows creating a Shape enum variant ShapeReference from a
ShapeReference struct. The ShapeReference struct is wrapped in a Box and
then converted to the Shape enum variant ShapeReference.
source§fn from(value: ShapeReference) -> Self
fn from(value: ShapeReference) -> Self
source§impl PartialEq<ShapeReference> for ShapeReference
impl PartialEq<ShapeReference> for ShapeReference
source§fn eq(&self, other: &ShapeReference) -> bool
fn eq(&self, other: &ShapeReference) -> bool
self and other values to be equal, and is used
by ==.