diff options
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 { } } } + + |
