[−][src]Struct ffi_convert::CRange
A utility type to represent range.
Note that the parametrized type T should have have CReprOf and AsRust trait implementated.
Example
use ffi_convert::{CReprOf, AsRust, CDrop, CRange}; use std::ops::Range; #[derive(Clone, Debug, PartialEq)] pub struct Foo { pub range: Range<i32> } #[derive(AsRust, CDrop, CReprOf, Debug, PartialEq)] #[target_type(Foo)] pub struct CFoo { pub range: CRange<i32> } let foo = Foo { range: Range { start: 20, end: 30, } }; let c_foo = CFoo { range: CRange { start: 20, end: 30, } }; let c_foo_converted = CFoo::c_repr_of(foo.clone()).unwrap(); assert_eq!(c_foo, c_foo_converted); let foo_converted = c_foo.as_rust().unwrap(); assert_eq!(foo_converted, foo);
Fields
start: Tend: TTrait Implementations
impl<U: AsRust<V>, V: PartialOrd + PartialEq> AsRust<Range<V>> for CRange<U>[src]
pub fn as_rust(&self) -> Result<Range<V>, AsRustError>[src]
impl<T> CDrop for CRange<T>[src]
pub fn do_drop(&mut self) -> Result<(), CDropError>[src]
impl<U: CReprOf<V> + CDrop, V: PartialOrd + PartialEq> CReprOf<Range<V>> for CRange<U>[src]
pub fn c_repr_of(input: Range<V>) -> Result<Self, CReprOfError>[src]
impl<T: Clone> Clone for CRange<T>[src]
impl<T: Debug> Debug for CRange<T>[src]
impl<T> Drop for CRange<T>[src]
impl<T: PartialEq> PartialEq<CRange<T>> for CRange<T>[src]
impl<T> StructuralPartialEq for CRange<T>[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for CRange<T> where
T: RefUnwindSafe, [src]
T: RefUnwindSafe,
impl<T> Send for CRange<T> where
T: Send, [src]
T: Send,
impl<T> Sync for CRange<T> where
T: Sync, [src]
T: Sync,
impl<T> Unpin for CRange<T> where
T: Unpin, [src]
T: Unpin,
impl<T> UnwindSafe for CRange<T> where
T: UnwindSafe, [src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,