pub enum ObjectType {
Galaxy,
PlanetaryNebula,
EmissionNebula,
ReflectionNebula,
DarkNebula,
OpenCluster,
GlobularCluster,
SupernovaRemnant,
GalaxyCluster,
DoubleStar,
Asterism,
Other,
}Expand description
Closed object-type enum mapped from SIMBAD otype.
Serialized as snake_case. Any SIMBAD otype outside the closed set maps
to ObjectType::Other (see map_otype); the raw string is preserved
separately on ResolvedIdentity::otype_raw for consumers needing finer
types.
use simbad_resolver::ObjectType;
assert_eq!(ObjectType::Galaxy.as_wire(), "galaxy");
assert_eq!(ObjectType::from_wire("planetary_nebula"), ObjectType::PlanetaryNebula);
assert_eq!(ObjectType::from_wire("bogus"), ObjectType::Other); // unknown → OtherVariants§
Galaxy
A galaxy (incl. interacting/active galaxy subtypes).
PlanetaryNebula
A planetary nebula.
EmissionNebula
An emission nebula (H II region, emission object).
ReflectionNebula
A reflection nebula.
DarkNebula
A dark/molecular cloud.
OpenCluster
An open/galactic cluster.
GlobularCluster
A globular cluster.
SupernovaRemnant
A supernova remnant.
GalaxyCluster
A cluster of galaxies.
DoubleStar
A double/multiple star.
Asterism
A visual asterism.
Other
Any object type outside the closed set above.
Implementations§
Source§impl ObjectType
impl ObjectType
Sourcepub fn as_wire(self) -> &'static str
pub fn as_wire(self) -> &'static str
The snake_case wire/DB string for this object type.
use simbad_resolver::ObjectType;
assert_eq!(ObjectType::GalaxyCluster.as_wire(), "galaxy_cluster");Sourcepub fn from_wire(s: &str) -> Self
pub fn from_wire(s: &str) -> Self
Parse a wire/DB string into an ObjectType. Unknown strings map to
ObjectType::Other (closed enum, forward-compatible read).
use simbad_resolver::ObjectType;
assert_eq!(ObjectType::from_wire("globular_cluster"), ObjectType::GlobularCluster);
assert_eq!(ObjectType::from_wire("not-a-real-type"), ObjectType::Other);