pub struct Context {
pub last_error: Option<ProjError>,
pub tmerc_algo: TmercAlgo,
/* private fields */
}Expand description
A lightweight transformation context.
Holds the last error encountered, the transverse-Mercator algorithm preference, and an in-memory registry of raw grid file bytes indexed by name.
Fields§
§last_error: Option<ProjError>The most recent error recorded on this context, if any.
tmerc_algo: TmercAlgoPreferred transverse-Mercator algorithm.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Context
pub fn new() -> Context
Create a fresh context with no error, TmercAlgo::Auto, and an empty grid registry.
Sourcepub fn register_grid(&mut self, name: impl Into<String>, data: Vec<u8>)
pub fn register_grid(&mut self, name: impl Into<String>, data: Vec<u8>)
Register raw grid bytes under name.
Subsequent calls to get_grid(name) (via GridRegistry) will return a
reference to these bytes. Calling this twice with the same name replaces
the previous data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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