Struct Context

Source
pub struct Context {
    pub stream: Stream,
    /* private fields */
}
Expand description

NPP stream context structure.

NPP documentation

Fields§

§stream: Stream

Implementations§

Source§

impl Context

Source

pub fn from_null_stream() -> Self

Create context on null stream.

This creates a context that can be passed to NPP functions. Any functions using this context will be executed on the null stream.

Source

pub fn from_stream(stream: Stream) -> Self

Create context.

This creates an NPP context object. It can be passed to NPP functions, and they will execute on the associated stream.

§Arguments
  • stream - Stream to associate with context.

Trait Implementations§

Source§

impl Drop for Context

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Context

Implements Send for Context.

§Safety

This is safe because the way we use the underlying NppStreamContext object is thread-safe.

Source§

impl Sync for Context

Implements Sync for Context.

§Safety

This is safe because the way we use the underlying NppStreamContext object is thread-safe.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.