pub struct Phantom {
pub id: String,
pub position: PhantomPosition,
pub size: Option<PhantomSize>,
pub content: PhantomContent,
pub connections: Vec<PhantomConnection>,
pub created: Option<DateTime<Utc>>,
pub author: Option<Collaborator>,
}Expand description
An individual phantom within a cluster.
Fields§
§id: StringUnique identifier for this phantom.
position: PhantomPositionPosition within the cluster’s coordinate space.
size: Option<PhantomSize>Optional size of this phantom.
content: PhantomContentContent of this phantom.
connections: Vec<PhantomConnection>Connections to other phantoms in the same cluster.
created: Option<DateTime<Utc>>When this phantom was created.
Author who created this phantom.
Implementations§
Source§impl Phantom
impl Phantom
Sourcepub fn new(
id: impl Into<String>,
position: PhantomPosition,
content: PhantomContent,
) -> Self
pub fn new( id: impl Into<String>, position: PhantomPosition, content: PhantomContent, ) -> Self
Create a new phantom.
Sourcepub fn with_size(self, size: PhantomSize) -> Self
pub fn with_size(self, size: PhantomSize) -> Self
Set the size.
Set the author.
Sourcepub fn with_connection(self, connection: PhantomConnection) -> Self
pub fn with_connection(self, connection: PhantomConnection) -> Self
Add a connection to another phantom.
Sourcepub fn connect_to(self, target_id: impl Into<String>) -> Self
pub fn connect_to(self, target_id: impl Into<String>) -> Self
Add a simple connection to another phantom by ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Phantom
impl<'de> Deserialize<'de> for Phantom
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
impl StructuralPartialEq for Phantom
Auto Trait Implementations§
impl Freeze for Phantom
impl RefUnwindSafe for Phantom
impl Send for Phantom
impl Sync for Phantom
impl Unpin for Phantom
impl UnsafeUnpin for Phantom
impl UnwindSafe for Phantom
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