pub struct Content {
version: FormatVersion,
title_block: TitleBlock,
blocks: BTreeMap<BlockId, Arc<Block>>,
pins: BTreeMap<PinId, Arc<Pin>>,
routes: BTreeMap<RouteId, Arc<Route>>,
route_labels: BTreeMap<RouteLabelId, Arc<RouteLabel>>,
texts: BTreeMap<TextId, Arc<Text>>,
areas: BTreeMap<AreaId, Arc<Area>>,
images: BTreeMap<ImageId, Arc<Image>>,
assets: HashedMap<AssetKind, Asset>,
}Expand description
Everything the document is, and exactly what a file holds: the entity
tables keyed by id, the title block flattened over them, and the artwork
payloads. BTreeMap rather than a hash map so the file is written in id
order without a sorting pass to forget.
Split from the session state beside it in Document — the log
position, the value stamp, the allocator’s marks — because those are
facts about this process’s copy rather than about the drawing.
Fields§
§version: FormatVersion§title_block: TitleBlock§blocks: BTreeMap<BlockId, Arc<Block>>§pins: BTreeMap<PinId, Arc<Pin>>§routes: BTreeMap<RouteId, Arc<Route>>§route_labels: BTreeMap<RouteLabelId, Arc<RouteLabel>>§texts: BTreeMap<TextId, Arc<Text>>§areas: BTreeMap<AreaId, Arc<Area>>§images: BTreeMap<ImageId, Arc<Image>>§assets: HashedMap<AssetKind, Asset>Artwork bytes, addressed by content. Not entities: no liveness and no lifecycle — a hash names one byte string forever, so the only question the table can answer is whether it is held.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Content
impl<'de> Deserialize<'de> for Content
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 Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnsafeUnpin for Content
impl UnwindSafe for Content
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