[−][src]Trait geos::ContextInteractions
Required methods
fn set_context_handle(&mut self, context: ContextHandle<'a>)
fn get_context_handle(&self) -> &ContextHandle<'a>
Provided methods
fn get_last_error(&self) -> Option<String>
Gets the last error (if any) from the ContextHandle
held by this object.
Example
use geos::{ContextInteractions, Geometry}; let mut point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)").expect("Invalid geometry"); // execute some calls on `point_geom` point_geom.get_last_error(); // This is a shortcut for calling: point_geom.get_context_handle().get_last_error();
fn get_last_notification(&self) -> Option<String>
Gets the last notification (if any) from the ContextHandle
held by this object.
Example
use geos::{ContextInteractions, Geometry}; let mut point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)").expect("Invalid geometry"); // execute some calls on `point_geom` point_geom.get_last_notification(); // This is a shortcut for calling: point_geom.get_context_handle().get_last_notification();
Implementors
impl<'a> ContextInteractions<'a> for CoordSeq<'a>
[src]
fn set_context_handle(&mut self, context: ContextHandle<'a>)
[src]
Set the context handle to the CoordSeq
.
use geos::{ContextInteractions, CoordDimensions, CoordSeq, ContextHandle}; let context_handle = ContextHandle::init().expect("invalid init"); context_handle.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s)))); let mut coord_seq = CoordSeq::new(2, CoordDimensions::TwoD).expect("failed to create CoordSeq"); coord_seq.set_context_handle(context_handle);
fn get_context_handle(&self) -> &ContextHandle<'a>
[src]
Get the context handle of the CoordSeq
.
use geos::{ContextInteractions, CoordDimensions, CoordSeq}; let coord_seq = CoordSeq::new(2, CoordDimensions::TwoD).expect("failed to create CoordSeq"); let context = coord_seq.get_context_handle(); context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));
impl<'a> ContextInteractions<'a> for Geometry<'a>
[src]
fn set_context_handle(&mut self, context: ContextHandle<'a>)
[src]
Set the context handle to the geometry.
use geos::{ContextInteractions, ContextHandle, Geometry}; let context_handle = ContextHandle::init().expect("invalid init"); context_handle.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s)))); let mut point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)").expect("Invalid geometry"); point_geom.set_context_handle(context_handle);
fn get_context_handle(&self) -> &ContextHandle<'a>
[src]
Get the context handle of the geometry.
use geos::{ContextInteractions, Geometry}; let point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)").expect("Invalid geometry"); let context = point_geom.get_context_handle(); context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));
impl<'a> ContextInteractions<'a> for PreparedGeometry<'a>
[src]
fn set_context_handle(&mut self, context: ContextHandle<'a>)
[src]
Set the context handle to the PreparedGeometry
.
use geos::{ ContextInteractions, ContextHandle, Geom, Geometry, PreparedGeometry, }; let point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)") .expect("Invalid geometry"); let context_handle = ContextHandle::init().expect("invalid init"); let mut prepared_geom = point_geom .to_prepared_geom() .expect("failed to create prepared geom"); context_handle.set_notice_message_handler( Some(Box::new(|s| println!("new message: {}", s))) ); prepared_geom.set_context_handle(context_handle);
fn get_context_handle(&self) -> &ContextHandle<'a>
[src]
Get the context handle of the PreparedGeometry
.
use geos::{ ContextInteractions, CoordDimensions, Geom, Geometry, PreparedGeometry, }; let point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)") .expect("Invalid geometry"); let prepared_geom = point_geom.to_prepared_geom() .expect("failed to create prepared geom"); let context = prepared_geom.get_context_handle(); context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));
impl<'a> ContextInteractions<'a> for WKBWriter<'a>
[src]
fn set_context_handle(&mut self, context: ContextHandle<'a>)
[src]
Set the context handle to the WKBWriter
.
use geos::{ContextInteractions, ContextHandle, WKBWriter}; let context_handle = ContextHandle::init().expect("invalid init"); let mut writer = WKBWriter::new().expect("failed to create WKT writer"); context_handle.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s)))); writer.set_context_handle(context_handle);
fn get_context_handle(&self) -> &ContextHandle<'a>
[src]
Get the context handle of the WKBWriter
.
use geos::{ContextInteractions, WKBWriter}; let mut writer = WKBWriter::new().expect("failed to create WKT writer"); let context = writer.get_context_handle(); context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));
impl<'a> ContextInteractions<'a> for WKTWriter<'a>
[src]
fn set_context_handle(&mut self, context: ContextHandle<'a>)
[src]
Set the context handle to the WKTWriter
.
use geos::{ContextInteractions, ContextHandle, WKTWriter}; let context_handle = ContextHandle::init().expect("invalid init"); let mut writer = WKTWriter::new().expect("failed to create WKT writer"); context_handle.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s)))); writer.set_context_handle(context_handle);
fn get_context_handle(&self) -> &ContextHandle<'a>
[src]
Get the context handle of the WKTWriter
.
use geos::{ContextInteractions, WKTWriter}; let mut writer = WKTWriter::new().expect("failed to create WKT writer"); let context = writer.get_context_handle(); context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));