Struct geodesy::Plain

source ·
pub struct Plain { /* private fields */ }
Expand description

A context provider, supporting built in and run-time defined operators, external grids, and macros. Sufficient for most uses, especially geodetic grid development. May get somewhat clunky when working with large numbers of grids or macros, as each reside in its own file.

Implementations§

source§

impl Plain

source

pub fn clear_grids()

To avoid having the heap allocated collection of grids stored in GRIDS growing through the roof, we may clear it occasionally. As the grids are behind an Arc reference counter, this is safe to do even though they may still be in use by some remaining operator instantiations.

Trait Implementations§

source§

impl Context for Plain

source§

fn op(&mut self, definition: &str) -> Result<OpHandle, Error>

Instantiate an operator. Recognizes PROJ syntax and converts it to Geodesy syntax. Bear in mind, however, that Geodesy does not support all PROJ operators, and that the input/output conventions differ.

source§

fn get_grid(&self, name: &str) -> Result<Arc<dyn Grid>, Error>

Access grid resources by identifier

source§

fn new() -> Plain

In general, implementations should make sure that new differs from default only by adding access to the builtin adaptors (geo:in, gis:out etc.)
source§

fn apply( &self, op: OpHandle, direction: Direction, operands: &mut dyn CoordinateSet ) -> Result<usize, Error>

Apply operation op to operands
source§

fn steps(&self, op: OpHandle) -> Result<&Vec<String>, Error>

Definitions of steps
source§

fn params(&self, op: OpHandle, index: usize) -> Result<ParsedParameters, Error>

Parsed parameters of a specific step
source§

fn globals(&self) -> BTreeMap<String, String>

Globally defined default values (typically just ellps=GRS80)
source§

fn register_op(&mut self, name: &str, constructor: OpConstructor)

Register a new user-defined operator
source§

fn get_op(&self, name: &str) -> Result<OpConstructor, Error>

Helper for the Op instantiation logic in Op::op(...)
source§

fn register_resource(&mut self, name: &str, definition: &str)

Register a new user-defined resource (macro, ellipsoid parameter set…)
source§

fn get_resource(&self, name: &str) -> Result<String, Error>

Helper for the Op instantiation logic in Op::op(...)
source§

fn get_blob(&self, name: &str) -> Result<Vec<u8>, Error>

Access blob-like resources by identifier
source§

impl Debug for Plain

source§

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

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

impl Default for Plain

source§

fn default() -> Plain

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

Auto Trait Implementations§

§

impl Freeze for Plain

§

impl !RefUnwindSafe for Plain

§

impl Send for Plain

§

impl Sync for Plain

§

impl Unpin for Plain

§

impl !UnwindSafe for Plain

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> CoordinateMetadata for T
where T: ?Sized,

source§

fn crs_id(&self) -> Option<MdIdentifier>

source§

fn crs(&self) -> Option<Crs>

source§

fn coordinate_epoch(&self) -> Option<DataEpoch>

source§

fn is_valid(&self) -> bool

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.