specctra: added hyperlinks

This commit is contained in:
hakki 2024-09-09 18:11:07 +02:00
parent 1fae63c8bd
commit 4a3c38abf3
1 changed files with 9 additions and 4 deletions

View File

@ -24,9 +24,14 @@ use crate::{
}; };
#[derive(Error, Debug)] #[derive(Error, Debug)]
/// Possible errors raised by [`SpecctraDesign::load`]
pub enum LoadingError { pub enum LoadingError {
/// I/O file reading error from [`std::io::Error`]
#[error(transparent)] #[error(transparent)]
Io(#[from] std::io::Error), Io(#[from] std::io::Error),
/// File parsing errors containing information about unexpected end of file,
/// or any other parsing issues with your DSN file
#[error(transparent)] #[error(transparent)]
Parse(#[from] read::ParseError), Parse(#[from] read::ParseError),
} }
@ -42,11 +47,11 @@ pub struct SpecctraDesign {
} }
impl SpecctraDesign { impl SpecctraDesign {
/// Reads a Specctra DSN file and initializes a `SpecctraDesign` instance. /// Reads a Specctra DSN file and initializes a [`SpecctraDesign`] instance.
/// ///
/// # Errors /// # Errors
/// ///
/// Returns a `LoadingError` if an I/O error occurs or if the file format is invalid. /// Returns a [`LoadingError`] if an I/O error occurs or if the file format is invalid.
pub fn load(reader: impl std::io::BufRead) -> Result<SpecctraDesign, LoadingError> { pub fn load(reader: impl std::io::BufRead) -> Result<SpecctraDesign, LoadingError> {
let mut list_reader = ListTokenizer::new(reader); let mut list_reader = ListTokenizer::new(reader);
let dsn = list_reader.read_value::<DsnFile>()?; let dsn = list_reader.read_value::<DsnFile>()?;
@ -63,7 +68,7 @@ impl SpecctraDesign {
/// ///
/// # Errors /// # Errors
/// ///
/// Returns an `std::io::Error` if an I/O error occurs while writing the SES file. /// Returns an [`std::io::Error`] if an I/O error occurs while writing the SES file.
pub fn write_ses( pub fn write_ses(
&self, &self,
board: &Board<SpecctraMesadata>, board: &Board<SpecctraMesadata>,
@ -170,7 +175,7 @@ impl SpecctraDesign {
} }
/// This method interprets the PCB design and generates a `Board<SpecctraMesadata>` object /// This method interprets the PCB design and generates a [`Board<SpecctraMesadata>`] object
/// containing the layout and associated Specctra mesadata . /// containing the layout and associated Specctra mesadata .
pub fn make_board(&self) -> Board<SpecctraMesadata> { pub fn make_board(&self) -> Board<SpecctraMesadata> {
let mesadata = SpecctraMesadata::from_pcb(&self.pcb); let mesadata = SpecctraMesadata::from_pcb(&self.pcb);