pub struct PhantomClusters {
pub version: String,
pub clusters: Vec<PhantomCluster>,
}Expand description
Root structure for phantom clusters stored at phantoms/clusters.json.
Fields§
§version: StringFormat version.
clusters: Vec<PhantomCluster>All phantom clusters in the document.
Implementations§
Source§impl PhantomClusters
impl PhantomClusters
Sourcepub fn add_cluster(&mut self, cluster: PhantomCluster)
pub fn add_cluster(&mut self, cluster: PhantomCluster)
Add a cluster.
Sourcepub fn find_cluster(&self, id: &str) -> Option<&PhantomCluster>
pub fn find_cluster(&self, id: &str) -> Option<&PhantomCluster>
Find a cluster by ID.
Sourcepub fn find_cluster_mut(&mut self, id: &str) -> Option<&mut PhantomCluster>
pub fn find_cluster_mut(&mut self, id: &str) -> Option<&mut PhantomCluster>
Find a cluster by ID mutably.
Sourcepub fn validate(&self, state: DocumentState) -> Vec<String>
pub fn validate(&self, state: DocumentState) -> Vec<String>
Validate all clusters.
Returns a list of validation errors, if any.
Trait Implementations§
Source§impl Clone for PhantomClusters
impl Clone for PhantomClusters
Source§fn clone(&self) -> PhantomClusters
fn clone(&self) -> PhantomClusters
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 PhantomClusters
impl Debug for PhantomClusters
Source§impl Default for PhantomClusters
impl Default for PhantomClusters
Source§impl<'de> Deserialize<'de> for PhantomClusters
impl<'de> Deserialize<'de> for PhantomClusters
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
Source§impl PartialEq for PhantomClusters
impl PartialEq for PhantomClusters
Source§impl Serialize for PhantomClusters
impl Serialize for PhantomClusters
impl StructuralPartialEq for PhantomClusters
Auto Trait Implementations§
impl Freeze for PhantomClusters
impl RefUnwindSafe for PhantomClusters
impl Send for PhantomClusters
impl Sync for PhantomClusters
impl Unpin for PhantomClusters
impl UnsafeUnpin for PhantomClusters
impl UnwindSafe for PhantomClusters
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