Skip to main content

AltiumDocument

Struct AltiumDocument 

Source
pub struct AltiumDocument<R: Read + Seek> { /* private fields */ }
Expand description

Unified entry point for working with Altium files.

Provides ergonomic access to any Altium file type through a common interface, with methods for accessing different abstraction layers.

Implementations§

Source§

impl AltiumDocument<File>

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>

Opens a file by path.

Source§

impl<R: Read + Seek> AltiumDocument<R>

Source

pub fn from_reader(reader: R) -> Result<Self>

Opens from a reader.

Source

pub fn cfb(&mut self) -> &mut AltiumCfb<R>

Returns the CFB wrapper for low-level operations.

Source

pub fn file_type(&self) -> AltiumFileType

Returns the detected file type.

Source

pub fn params(&mut self, stream_path: &str) -> Result<&ParamsContainer>

Gets records from a stream as a parameter container.

Loads and caches the container on first access.

Source

pub fn params_mut(&mut self, stream_path: &str) -> Result<&mut ParamsContainer>

Gets mutable records from a stream.

Source

pub fn binary(&mut self, stream_path: &str) -> Result<&BinaryContainer>

Gets binary records from a stream.

Source

pub fn binary_mut(&mut self, stream_path: &str) -> Result<&mut BinaryContainer>

Gets mutable binary records from a stream.

Source

pub fn component_names(&mut self) -> Result<Vec<String>>

For libraries: lists component/footprint names.

Source

pub fn resolve_component(&mut self, name: &str) -> Result<String>

Resolves a component name to its storage path.

Source

pub fn clear_cache(&mut self)

Clears all cached containers.

Auto Trait Implementations§

§

impl<R> Freeze for AltiumDocument<R>

§

impl<R> RefUnwindSafe for AltiumDocument<R>

§

impl<R> Send for AltiumDocument<R>
where R: Send + Sync,

§

impl<R> Sync for AltiumDocument<R>
where R: Send + Sync,

§

impl<R> Unpin for AltiumDocument<R>

§

impl<R> UnwindSafe for AltiumDocument<R>

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool