pub struct CachedTarget {
pub id: Uuid,
pub simbad_oid: Option<i64>,
pub primary_designation: String,
pub common_name: Option<String>,
pub object_type: ObjectType,
pub otype_raw: String,
pub ra_deg: f64,
pub dec_deg: f64,
pub v_mag: Option<f64>,
pub source: TargetSource,
pub resolved_at: String,
pub aliases: Vec<ResolvedAlias>,
}Expand description
A cached canonical target plus its aliases, as read back from a Cache.
Mirrors ResolvedIdentity but additionally carries the persisted
CachedTarget::id and CachedTarget::resolved_at.
Fields§
§id: UuidPersisted target id (UUIDv5 derived from the caller namespace).
simbad_oid: Option<i64>SIMBAD physical-object id (dedup key) when resolved online.
primary_designation: StringCanonical display designation.
common_name: Option<String>Curated common name when one exists.
object_type: ObjectTypeClosed object-type classification.
otype_raw: StringRaw SIMBAD otype string (escape hatch alongside object_type).
ra_deg: f64ICRS J2000 right ascension, decimal degrees.
dec_deg: f64ICRS J2000 declination, decimal degrees.
v_mag: Option<f64>Johnson V-band apparent magnitude (SIMBAD allfluxes.V) when known.
source: TargetSourceProvenance of the stored identity.
resolved_at: StringRFC 3339 timestamp of the last seed/resolve/override.
aliases: Vec<ResolvedAlias>All aliases (designations + common names + user-added).
Implementations§
Source§impl CachedTarget
impl CachedTarget
Sourcepub fn to_identity(&self) -> ResolvedIdentity
pub fn to_identity(&self) -> ResolvedIdentity
Build a ResolvedIdentity view of this cached target.
use simbad_resolver::{AliasKind, CachedTarget, ObjectType, ResolvedAlias, TargetSource};
use uuid::Uuid;
let target = CachedTarget {
id: Uuid::nil(),
simbad_oid: Some(1_575_544),
primary_designation: "M 31".to_owned(),
common_name: Some("Andromeda Galaxy".to_owned()),
object_type: ObjectType::Galaxy,
otype_raw: "G".to_owned(),
ra_deg: 10.684_708,
dec_deg: 41.268_75,
v_mag: Some(3.44),
source: TargetSource::Resolved,
resolved_at: "2026-07-11T00:00:00Z".to_owned(),
aliases: vec![ResolvedAlias::new("NGC 224", AliasKind::Designation)],
};
let identity = target.to_identity();
assert_eq!(identity.primary_designation, "M 31");
assert_eq!(identity.aliases, target.aliases);Sourcepub fn position(&self) -> Result<Equatorial>
pub fn position(&self) -> Result<Equatorial>
This target’s sky position as a typed skymath::Equatorial coordinate.
SIMBAD coordinates are ICRS; at planning grade (≤ ~1 arcminute) ICRS is
treated as J2000. The raw Self::ra_deg / Self::dec_deg fields
remain the canonical storage.
§Errors
skymath::Error::OutOfRange if the stored values are outside RA
[0, 360) / Dec [-90, +90] (malformed cache content).
use simbad_resolver::{AliasKind, CachedTarget, ObjectType, ResolvedAlias, TargetSource};
use uuid::Uuid;
let target = CachedTarget {
id: Uuid::nil(), simbad_oid: Some(1_575_544), primary_designation: "M 31".to_owned(),
common_name: None, object_type: ObjectType::Galaxy, otype_raw: "G".to_owned(),
ra_deg: 10.684_708, dec_deg: 41.268_75, v_mag: Some(3.44),
source: TargetSource::Resolved, resolved_at: "2026-07-11T00:00:00Z".to_owned(),
aliases: vec![ResolvedAlias::new("M 31", AliasKind::Designation)],
};
let eq = target.position()?;
assert!((eq.ra().degrees() - 10.684_708).abs() < 1e-6);