pub struct Sheet {Show 14 fields
pub id: String,
pub name: String,
pub size: String,
pub width_mm: f64,
pub height_mm: f64,
pub border: bool,
pub border_inset_mm: f64,
pub title_block: bool,
pub notes: String,
pub views: Vec<PlacedView>,
pub dimensions: Vec<SheetDimension>,
pub ordinates: Vec<SheetOrdinate>,
pub revisions: Vec<Revision>,
pub bom_table: Option<BomTable>,
}Expand description
One sheet of paper.
Fields§
§id: String§name: String§size: StringA PAPER_SIZES key, or CUSTOM.
width_mm: f64§height_mm: f64§border: boolDraw the BORDER: the rectangle inset from the paper’s edge that the drawing lives inside. On by default; a sheet may switch it off.
border_inset_mm: f64How far the border sits from the paper’s edge, millimetres. It is also the margin the TITLE BLOCK is placed against, so a sheet with no border still has a margin.
title_block: boolDraw the TITLE BLOCK in the paper’s bottom-right corner, inside the border. On by default.
notes: StringThe title block’s free text field — whatever the drawing has to say.
views: Vec<PlacedView>§dimensions: Vec<SheetDimension>The sheet’s OWN dimensions — drawn on the paper, anchored to the
projected geometry of the placements above (dimension). A sheet
saved before they existed simply has none.
ordinates: Vec<SheetOrdinate>The sheet’s ORDINATE SETS (ordinate) — a datum and a run of
members, each reading its signed distance from the datum. Beside the
dimensions rather than among them: a set measures any number of points
against one origin and draws no dimension line, which is a different
object and not a fifth kind.
revisions: Vec<Revision>The sheet’s REVISIONS, oldest first as the user keeps them — drawn as
the revision table beside the title block (frame). A sheet saved
before they existed has none, and a sheet with none draws no table.
bom_table: Option<BomTable>Implementations§
Source§impl Sheet
impl Sheet
Sourcepub fn millimetres(&self) -> (f64, f64)
pub fn millimetres(&self) -> (f64, f64)
The paper’s millimetres: the preset’s when size names one (so a
preset sheet cannot drift), else the stored custom pair.
Sourcepub fn border_inset(&self) -> f64
pub fn border_inset(&self) -> f64
The border’s inset, clamped to something the paper can carry: a sheet whose inset ate the page would have no drawing area at all.
pub fn find_view(&self, id: &str) -> Option<&PlacedView>
pub fn find_view_mut(&mut self, id: &str) -> Option<&mut PlacedView>
pub fn find_dimension(&self, id: &str) -> Option<&SheetDimension>
pub fn find_ordinate(&self, id: &str) -> Option<&SheetOrdinate>
Sourcepub fn next_view_letter(&self, views: &[PmiView]) -> String
pub fn next_view_letter(&self, views: &[PmiView]) -> String
The next view LETTER this sheet has not handed out, for a section or a
detail alike: the two draw from ONE run of letters, because a drawing
with a SECTION A—A and a DETAIL A names two different views with
one letter. A sheet past Z reuses the last one rather than refusing
the view: two views sharing a letter is a drawing-office mistake, not a
broken document, and the form is where it is corrected. views are
the document’s PMI views: a placement of a SECTIONED saved view holds
a letter too (Self::view_letters).
Sourcepub fn view_letters(&self, views: &[PmiView]) -> Vec<Option<String>>
pub fn view_letters(&self, views: &[PmiView]) -> Vec<Option<String>>
Each placement’s letter, in placement order. A section or a detail
carries its own. A plain placement of a saved view that is itself
SECTIONED (its PMI view’s display has a section) is captioned
SECTION A—A too, and takes the first letter nothing stored holds and
no earlier such placement took — so it is the same letter every time
the sheet is drawn, and a section or detail added later skips it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sheet
impl<'de> Deserialize<'de> for Sheet
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>,
impl StructuralPartialEq for Sheet
Auto Trait Implementations§
impl Forget for Sheet
impl Freeze for Sheetwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<PlacedView>: Freeze,
PhantomData<SheetDimension>: Freeze,
PhantomData<SheetOrdinate>: Freeze,
PhantomData<Revision>: Freeze,
PhantomData<String>: Freeze,
impl Move for Sheet
impl RefUnwindSafe for Sheet
impl Send for Sheetwhere
RawVecInner: Send,
impl Sync for Sheetwhere
RawVecInner: Sync,
impl Unpin for Sheet
impl UnsafeUnpin for Sheetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<PlacedView>: UnsafeUnpin,
PhantomData<SheetDimension>: UnsafeUnpin,
PhantomData<SheetOrdinate>: UnsafeUnpin,
PhantomData<Revision>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Sheetwhere
RawVecInner: UnwindSafe,
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
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> 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> ⓘ
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> ⓘ
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.