Skip to main content

Layer

Struct Layer 

Source
pub struct Layer(pub u8);
Expand description

PCB layer identifier.

Altium uses byte values (0-255) to identify layers.

Tuple Fields§

§0: u8

Implementations§

Source§

impl Layer

Source

pub const NO_LAYER: Layer

Source

pub const TOP_LAYER: Layer

Source

pub const MID_LAYER_1: Layer

Source

pub const MID_LAYER_2: Layer

Source

pub const MID_LAYER_3: Layer

Source

pub const MID_LAYER_4: Layer

Source

pub const MID_LAYER_5: Layer

Source

pub const MID_LAYER_6: Layer

Source

pub const MID_LAYER_7: Layer

Source

pub const MID_LAYER_8: Layer

Source

pub const MID_LAYER_9: Layer

Source

pub const MID_LAYER_10: Layer

Source

pub const MID_LAYER_11: Layer

Source

pub const MID_LAYER_12: Layer

Source

pub const MID_LAYER_13: Layer

Source

pub const MID_LAYER_14: Layer

Source

pub const MID_LAYER_15: Layer

Source

pub const MID_LAYER_16: Layer

Source

pub const MID_LAYER_17: Layer

Source

pub const MID_LAYER_18: Layer

Source

pub const MID_LAYER_19: Layer

Source

pub const MID_LAYER_20: Layer

Source

pub const MID_LAYER_21: Layer

Source

pub const MID_LAYER_22: Layer

Source

pub const MID_LAYER_23: Layer

Source

pub const MID_LAYER_24: Layer

Source

pub const MID_LAYER_25: Layer

Source

pub const MID_LAYER_26: Layer

Source

pub const MID_LAYER_27: Layer

Source

pub const MID_LAYER_28: Layer

Source

pub const MID_LAYER_29: Layer

Source

pub const MID_LAYER_30: Layer

Source

pub const BOTTOM_LAYER: Layer

Source

pub const TOP_OVERLAY: Layer

Source

pub const BOTTOM_OVERLAY: Layer

Source

pub const TOP_PASTE: Layer

Source

pub const BOTTOM_PASTE: Layer

Source

pub const TOP_SOLDER: Layer

Source

pub const BOTTOM_SOLDER: Layer

Source

pub const INTERNAL_PLANE_1: Layer

Source

pub const INTERNAL_PLANE_2: Layer

Source

pub const INTERNAL_PLANE_3: Layer

Source

pub const INTERNAL_PLANE_4: Layer

Source

pub const INTERNAL_PLANE_5: Layer

Source

pub const INTERNAL_PLANE_6: Layer

Source

pub const INTERNAL_PLANE_7: Layer

Source

pub const INTERNAL_PLANE_8: Layer

Source

pub const INTERNAL_PLANE_9: Layer

Source

pub const INTERNAL_PLANE_10: Layer

Source

pub const INTERNAL_PLANE_11: Layer

Source

pub const INTERNAL_PLANE_12: Layer

Source

pub const INTERNAL_PLANE_13: Layer

Source

pub const INTERNAL_PLANE_14: Layer

Source

pub const INTERNAL_PLANE_15: Layer

Source

pub const INTERNAL_PLANE_16: Layer

Source

pub const DRILL_GUIDE: Layer

Source

pub const KEEP_OUT_LAYER: Layer

Source

pub const MECHANICAL_1: Layer

Source

pub const MECHANICAL_2: Layer

Source

pub const MECHANICAL_3: Layer

Source

pub const MECHANICAL_4: Layer

Source

pub const MECHANICAL_5: Layer

Source

pub const MECHANICAL_6: Layer

Source

pub const MECHANICAL_7: Layer

Source

pub const MECHANICAL_8: Layer

Source

pub const MECHANICAL_9: Layer

Source

pub const MECHANICAL_10: Layer

Source

pub const MECHANICAL_11: Layer

Source

pub const MECHANICAL_12: Layer

Source

pub const MECHANICAL_13: Layer

Source

pub const MECHANICAL_14: Layer

Source

pub const MECHANICAL_15: Layer

Source

pub const MECHANICAL_16: Layer

Source

pub const DRILL_DRAWING: Layer

Source

pub const MULTI_LAYER: Layer

Source

pub const CONNECT_LAYER: Layer

Source

pub const BACKGROUND_LAYER: Layer

Source

pub const DRC_ERROR_LAYER: Layer

Source

pub const HIGHLIGHT_LAYER: Layer

Source

pub const GRID_COLOR_1: Layer

Source

pub const GRID_COLOR_10: Layer

Source

pub const PAD_HOLE_LAYER: Layer

Source

pub const VIA_HOLE_LAYER: Layer

Source

pub const TOP_PAD_MASTER: Layer

Source

pub const BOTTOM_PAD_MASTER: Layer

Source

pub const DRC_DETAIL_LAYER: Layer

Source

pub const MECHANICAL_17: Layer

Source

pub const MECHANICAL_18: Layer

Source

pub const MECHANICAL_19: Layer

Source

pub const MECHANICAL_20: Layer

Source

pub const MECHANICAL_21: Layer

Source

pub const MECHANICAL_22: Layer

Source

pub const MECHANICAL_23: Layer

Source

pub const MECHANICAL_24: Layer

Source

pub const MECHANICAL_25: Layer

Source

pub const MECHANICAL_26: Layer

Source

pub const MECHANICAL_27: Layer

Source

pub const MECHANICAL_28: Layer

Source

pub const MECHANICAL_29: Layer

Source

pub const MECHANICAL_30: Layer

Source

pub const MECHANICAL_31: Layer

Source

pub const MECHANICAL_32: Layer

Source

pub const UNKNOWN: Layer

Source

pub const fn new(value: u8) -> Self

Creates a new Layer from a u8 value.

Source

pub const fn multi_layer() -> Self

Returns the MultiLayer constant (for through-hole pads).

Source

pub const fn from_byte(value: u8) -> Self

Creates a layer from a byte value.

Source

pub const fn to_byte(self) -> u8

Returns the byte value of this layer.

Source

pub fn name(self) -> &'static str

Returns the internal name of this layer.

Source

pub fn from_name(name: &str) -> Option<Layer>

Parses a layer from its name string.

Source

pub fn is_copper(self) -> bool

Returns true if this is a copper layer (top, bottom, or mid layers).

Source

pub fn is_plane(self) -> bool

Returns true if this is an internal plane layer.

Source

pub fn is_mechanical(self) -> bool

Returns true if this is a mechanical layer (1-32).

Source

pub fn is_signal(self) -> bool

Returns true if this is a signal layer (top, bottom, or mid).

Source

pub fn is_overlay(self) -> bool

Returns true if this is an overlay/silkscreen layer.

Trait Implementations§

Source§

impl Clone for Layer

Source§

fn clone(&self) -> Layer

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Layer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Layer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Layer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<Layer> for Value

Source§

fn from(v: Layer) -> Self

Converts to this type from the input type.
Source§

impl From<Layer> for u8

Source§

fn from(layer: Layer) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Layer

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl FromBinary for Layer

Source§

fn read_from<R: Read>(reader: &mut R) -> Result<Self>

Read this type from a binary stream.
Source§

fn read_from_preserving<R: Read>( reader: &mut R, _block_size: usize, ) -> Result<(Self, Vec<u8>)>

Read this type and preserve remaining bytes for non-destructive editing. Read more
Source§

impl Hash for Layer

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Layer

Source§

fn cmp(&self, other: &Layer) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Layer

Source§

fn eq(&self, other: &Layer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Layer

Source§

fn partial_cmp(&self, other: &Layer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToBinary for Layer

Source§

fn write_to<W: Write>(&self, writer: &mut W) -> Result<()>

Write this type to a binary stream.
Source§

fn binary_size(&self) -> usize

Calculate the binary size of this type. Read more
Source§

impl Copy for Layer

Source§

impl Eq for Layer

Source§

impl StructuralPartialEq for Layer

Auto Trait Implementations§

§

impl Freeze for Layer

§

impl RefUnwindSafe for Layer

§

impl Send for Layer

§

impl Sync for Layer

§

impl Unpin for Layer

§

impl UnwindSafe for Layer

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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