geos/
traits.rs

1pub trait AsRaw {
2    type RawType;
3
4    fn as_raw(&self) -> *const Self::RawType;
5}
6
7pub trait AsRawMut {
8    type RawType;
9
10    fn as_raw_mut(&mut self) -> *mut Self::RawType {
11        unsafe { self.as_raw_mut_override() }
12    }
13    /// This method exists because in certain case, even though you don't run any mutable operation
14    /// on the object, it still requires a mutable access.
15    ///
16    /// A good example is `GEOSWKTWriter_getOutputDimension_r` (which is very likely a bug).
17    unsafe fn as_raw_mut_override(&self) -> *mut Self::RawType;
18}