diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-10-16 21:01:58 +0200 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-10-24 07:12:55 +0200 |
| commit | a4ffe47c51d1617fc0e728c7bbd7e9b3738878cb (patch) | |
| tree | 017d0717ac8e2d5e0f6a46e47ea9e731ce63697b /src/utils.rs | |
| parent | b93d4cb749714699b44b2566e50a7086c2854ac7 (diff) | |
| download | mail-a4ffe47c51d1617fc0e728c7bbd7e9b3738878cb.tar.gz | |
some tries towards better lifetimes
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs index bdc8c4f..9de7e08 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,10 +4,14 @@ use std::{ }; use libc; -pub trait NewFromPtr<T> { - fn new(ptr: T) -> Self; +pub trait FromPtr<T> { + fn from_ptr(ptr: T) -> Self; } +// pub trait NewFromPtr<T, P> { +// fn new(ptr: T, parent: Rc<P>) -> Self; +// } + pub trait ToStr { fn to_str<'a>(&self) -> Result<&'a str, str::Utf8Error>; } @@ -31,3 +35,5 @@ impl ToString for *const libc::c_char { } } } + + |
