FromRawCStream

Trait FromRawCStream 

Source
pub trait FromRawCStream {
    // Required method
    unsafe fn from_raw_c_stream(raw: RawCStream) -> Self;
}
Expand description

A trait to express the ability to construct an object from a raw stream.

Required Methods§

Source

unsafe fn from_raw_c_stream(raw: RawCStream) -> Self

Constructs a new instance of Self from the given raw stream.

This function is typically used to consume ownership of the specified stream. When used in this way, the returned object will take responsibility for closing it when the object goes out of scope.

§Safety
  • The stream passed in must be an owned stream; in particular, it must be open.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§