Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

ProjectView

Struct ProjectView 

Source
pub struct ProjectView<'a> { /* private fields */ }

Implementations§

Source§

impl ProjectView<'_>

Source

pub fn fabrication_design_rules( &self, ) -> Result<ProjectFabricationRules, ProjectError>

Read only declared minimum rules. This does not measure board geometry.

Source§

impl<'a> ProjectView<'a>

Source

pub const fn raw(&self) -> &'a Map<String, Value>

Source

pub fn schematic_worksheet_path(&self) -> Result<Option<&'a str>, ProjectError>

Exact selected schematic worksheet locator; an absent/empty value selects the default. The caller resolves a relative locator against the explicitly selected project directory.

Source

pub fn text_variables(&self) -> Result<Vec<(String, String)>, ProjectError>

Source

pub fn schematic_drawing_settings(&self) -> SchematicDrawingSettings

Return KiCad’s schematic drawing settings in the units consumed by the typed plotter. Project line thickness is stored in mils.

Source

pub fn schematic_junction_diameter_nm(&self) -> i64

The diameter KiCad draws a junction whose own diameter is zero (SCHEMATIC_SETTINGS::GetJunctionSize): the Default net class’s wire width (6 mil unless the project sets one) times the multiplier junction_size_choice selects (None, Smallest, Small, Default, Large, Largest), rounded to KiCad’s 100 nm unit, nanometres.

Source

pub fn top_level_sheets(&self) -> Vec<(String, String)>

schematic.top_level_sheets: each entry’s (filename, name), in order. A field that is not a string reads as empty.

Source

pub fn root_sheet_name( &self, project_name: &str, root_schematic_file: &str, file_exists: impl Fn(&str) -> bool, ) -> String

The name KiCad 10.0.8 gives the root sheet when it loads root_schematic_file (a /-separated path relative to the project directory) with this project, as ${SHEETNAME} shows it.

PROJECT_FILE::LoadFromFile (common/project/project_file.cpp:692-755) gives a project without top-level sheets one entry named for the project, <project_name>.kicad_sch, and points an entry whose file is missing at that file. EESCHEMA_HELPERS::LoadSchematic (eeschema/eeschema_helpers.cpp:140-196) then takes the name of the entry for the loaded file. With one entry, an empty name or no matching entry gives “Root”; with several, the entry’s name is kept as it is. Without a project the name is “Root” (see ROOT_SHEET_DEFAULT_NAME).

Source

pub fn variants(&self) -> Result<Vec<ProjectVariant>, ProjectError>

Source

pub fn bus_aliases(&self) -> Result<Vec<ProjectBusAlias>, ProjectError>

Source

pub fn net_settings(&self) -> Result<ProjectNetSettings, ProjectError>

Source

pub fn board_design_settings( &self, ) -> Result<ProjectBoardDesignSettings, ProjectError>

Source

pub fn get_path(&self, dotted_path: &str) -> Option<&'a Value>

Trait Implementations§

Source§

impl<'a> Clone for ProjectView<'a>

Source§

fn clone(&self) -> ProjectView<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for ProjectView<'a>

Source§

impl<'a> Debug for ProjectView<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ProjectView<'a>

§

impl<'a> RefUnwindSafe for ProjectView<'a>

§

impl<'a> Send for ProjectView<'a>

§

impl<'a> Sync for ProjectView<'a>

§

impl<'a> Unpin for ProjectView<'a>

§

impl<'a> UnsafeUnpin for ProjectView<'a>

§

impl<'a> UnwindSafe for ProjectView<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.