pub struct CanvasDocument { /* private fields */ }Implementations§
Source§impl CanvasDocument
impl CanvasDocument
pub fn new() -> Self
pub fn builder() -> CanvasDocumentBuilder
pub fn format_version(&self) -> u32
pub fn metadata(&self) -> &CanvasValue
pub fn relations(&self) -> &CanvasRecordRelations
pub fn node(&self, id: &NodeId) -> Option<&CanvasNode>
pub fn edge(&self, id: &EdgeId) -> Option<&CanvasEdge>
pub fn shape(&self, id: &ShapeId) -> Option<&CanvasShape>
pub fn contains_node(&self, id: &NodeId) -> bool
pub fn contains_edge(&self, id: &EdgeId) -> bool
pub fn contains_shape(&self, id: &ShapeId) -> bool
pub fn contains_record(&self, id: &CanvasRecordId) -> bool
pub fn nodes(&self) -> impl Iterator<Item = &CanvasNode> + '_
pub fn edges(&self) -> impl Iterator<Item = &CanvasEdge> + '_
pub fn shapes(&self) -> impl Iterator<Item = &CanvasShape> + '_
pub fn node_entries(&self) -> impl Iterator<Item = (&NodeId, &CanvasNode)> + '_
pub fn edge_entries(&self) -> impl Iterator<Item = (&EdgeId, &CanvasEdge)> + '_
pub fn shape_entries( &self, ) -> impl Iterator<Item = (&ShapeId, &CanvasShape)> + '_
pub fn node_ids(&self) -> impl Iterator<Item = &NodeId> + '_
pub fn edge_ids(&self) -> impl Iterator<Item = &EdgeId> + '_
pub fn shape_ids(&self) -> impl Iterator<Item = &ShapeId> + '_
pub fn node_count(&self) -> usize
pub fn edge_count(&self) -> usize
pub fn shape_count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn from_snapshot(snapshot: CanvasSnapshot) -> Result<Self, DocumentError>
pub fn from_snapshot_with_kind_registry( snapshot: CanvasSnapshot, kind_registry: &CanvasKindRegistry, ) -> Result<Self, DocumentError>
pub fn to_snapshot(&self) -> CanvasSnapshot
pub fn apply_transaction( &mut self, transaction: CanvasTransaction, ) -> Result<(), DocumentError>
pub fn apply_transaction_with_diff( &mut self, transaction: CanvasTransaction, ) -> Result<CanvasDocumentDiff, DocumentError>
pub fn commit_transaction( &mut self, transaction: CanvasTransaction, ) -> Result<CanvasCommittedMutation, DocumentError>
pub fn commit_transaction_with_kind_registry( &mut self, transaction: CanvasTransaction, kind_registry: &CanvasKindRegistry, ) -> Result<CanvasCommittedMutation, DocumentError>
pub fn invert_transaction( &self, transaction: &CanvasTransaction, ) -> Result<CanvasTransaction, DocumentError>
pub fn validate_endpoint( &self, endpoint: &CanvasEndpoint, ) -> Result<(), DocumentError>
pub fn validate_edge(&self, edge: &CanvasEdge) -> Result<(), DocumentError>
pub fn validate_integrity(&self) -> Result<(), DocumentError>
pub fn endpoint_position( &self, endpoint: &CanvasEndpoint, ) -> Result<Point<Pixels>, DocumentError>
pub fn edge_route_path( &self, edge: &CanvasEdge, ) -> Result<CanvasRoutePath, DocumentError>
pub fn edge_route_path_with_router<R>(
&self,
edge: &CanvasEdge,
router: &R,
) -> Result<CanvasRoutePath, DocumentError>where
R: CanvasEdgeRouter + ?Sized,
pub fn edge_bounds( &self, edge: &CanvasEdge, ) -> Result<Bounds<Pixels>, DocumentError>
pub fn edge_bounds_with_router<R>(
&self,
edge: &CanvasEdge,
router: &R,
) -> Result<Bounds<Pixels>, DocumentError>where
R: CanvasEdgeRouter + ?Sized,
pub fn edge_route_points( &self, edge: &CanvasEdge, ) -> Result<Vec<Point<Pixels>>, DocumentError>
pub fn diff_against(&self, previous: &CanvasDocument) -> CanvasDocumentDiff
pub fn validate_relations(&self) -> Result<(), DocumentError>
Source§impl CanvasDocument
impl CanvasDocument
pub fn graph(&self) -> CanvasGraph<'_>
pub fn graph_index(&self) -> CanvasGraphIndex
Trait Implementations§
Source§impl Clone for CanvasDocument
impl Clone for CanvasDocument
Source§fn clone(&self) -> CanvasDocument
fn clone(&self) -> CanvasDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CanvasDocument
impl Debug for CanvasDocument
Source§impl Default for CanvasDocument
impl Default for CanvasDocument
Source§impl<'de> Deserialize<'de> for CanvasDocument
impl<'de> Deserialize<'de> for CanvasDocument
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 From<&CanvasDocument> for CanvasSnapshot
impl From<&CanvasDocument> for CanvasSnapshot
Source§fn from(value: &CanvasDocument) -> Self
fn from(value: &CanvasDocument) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CanvasDocument
impl PartialEq for CanvasDocument
Source§fn eq(&self, other: &CanvasDocument) -> bool
fn eq(&self, other: &CanvasDocument) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CanvasDocument
impl Serialize for CanvasDocument
impl StructuralPartialEq for CanvasDocument
Source§impl TryFrom<&CanvasDocument> for JsonCanvas
impl TryFrom<&CanvasDocument> for JsonCanvas
Source§type Error = JsonCanvasError
type Error = JsonCanvasError
The type returned in the event of a conversion error.
Source§impl TryFrom<CanvasSnapshot> for CanvasDocument
impl TryFrom<CanvasSnapshot> for CanvasDocument
Source§type Error = DocumentError
type Error = DocumentError
The type returned in the event of a conversion error.
Source§impl TryFrom<JsonCanvas> for CanvasDocument
impl TryFrom<JsonCanvas> for CanvasDocument
Source§type Error = JsonCanvasError
type Error = JsonCanvasError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for CanvasDocument
impl RefUnwindSafe for CanvasDocument
impl Send for CanvasDocument
impl Sync for CanvasDocument
impl Unpin for CanvasDocument
impl UnsafeUnpin for CanvasDocument
impl UnwindSafe for CanvasDocument
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().