amazon-ion / ion-rust

Rust implementation of Amazon Ion
Apache License 2.0
147 stars 35 forks source link

It seems `Position` is not publicly nameable #809

Open jpschorr opened 1 month ago

jpschorr commented 1 month ago

It seems Position is not publicly accessible: https://github.com/amazon-ion/ion-rust/blob/main/src/lib.rs#L181

Using

ion-rs = { version = "1.0.0-rc.6", features = ["experimental"] }

Given an IonError, err:

This works:

        let position: Option<_> = match err {
            IonError::Incomplete(e) => Some(e.position()),
            IonError::Decoding(e) => e.position(),
            _ => None,
        };

But there is no way to explicitly name the type for the position variable, because I can’t actually import the Position type

        let position: Option<&Position> = ...
286 |         let position: Option<&Position> = match &self.0 {
    |                               ^^^^^^^^ not found in this scope