pub struct Catalog {
pub source: String,
pub snapshot: Snapshot,
pub selection: String,
pub motors: Vec<CatalogMotor>,
}Expand description
A motor catalog.
Fields§
§source: StringWhere the curve files come from.
snapshot: SnapshotWhere and when the curve files were downloaded.
selection: StringThe rule that chose the curves.
motors: Vec<CatalogMotor>The motors.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn bundled() -> Result<Self, MotorError>
pub fn bundled() -> Result<Self, MotorError>
The catalog compiled into this crate.
§Errors
MotorError::Catalog if the bundled index doesn’t deserialize, which a test rules out.
Sourcepub fn from_json(text: &str) -> Result<Self, MotorError>
pub fn from_json(text: &str) -> Result<Self, MotorError>
Sourcepub fn find<'a>(
&'a self,
name: &str,
) -> impl Iterator<Item = &'a CatalogMotor> + 'a
pub fn find<'a>( &'a self, name: &str, ) -> impl Iterator<Item = &'a CatalogMotor> + 'a
The motors whose designation or common name matches name, ignoring ASCII case, spaces
and hyphens (j760, 1266J760-19A, K 940).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Catalog
impl<'de> Deserialize<'de> for Catalog
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Catalog
Auto Trait Implementations§
impl Freeze for Catalog
impl RefUnwindSafe for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
impl UnwindSafe for Catalog
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
Mutably borrows from an owned value. Read more