diff options
| author | C. Morgan Hamill <me@cmhamill.org> | 2015-03-27 20:39:02 +0100 |
|---|---|---|
| committer | C. Morgan Hamill <me@cmhamill.org> | 2015-03-27 20:39:02 +0100 |
| commit | 9005a1b8656ed0bcd8526810206836eeeb919d38 (patch) | |
| tree | caeefae886e669c81b37d46175e879ad15144d08 | |
| parent | ed50bef4947c739032f7282054cd41103e9d1192 (diff) | |
| download | mail-9005a1b8656ed0bcd8526810206836eeeb919d38.tar.gz | |
Add `NewFromPtr` trait.
Crate-private utility trait for `new()` methods on types.
| -rw-r--r-- | src/utils.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index b5acb66..af3ce29 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -8,6 +8,10 @@ use std::os::unix::ffi::OsStrExt; use libc; +pub trait NewFromPtr<T> { + fn new(ptr: T) -> Self; +} + pub trait ToCString { fn to_cstring(&self) -> Result<ffi::CString, ffi::NulError>; } |
