Skip to main content

RawBidirectionalStreamCallback

Struct RawBidirectionalStreamCallback 

Source
#[repr(C)]
pub struct RawBidirectionalStreamCallback { pub on_stream_ready: Option<extern "C" fn(stream: RawBidirectionalStream)>, pub on_response_headers_received: Option<extern "C" fn(stream: RawBidirectionalStream, headers: *const RawBidirectionalStreamHeaderArray, negotiated_protocol: *const c_char)>, pub on_read_completed: Option<extern "C" fn(stream: RawBidirectionalStream, data: *mut c_char, bytes_read: i32)>, pub on_write_completed: Option<extern "C" fn(stream: RawBidirectionalStream, data: *const c_char)>, pub on_response_trailers_received: Option<extern "C" fn(stream: RawBidirectionalStream, trailers: *const RawBidirectionalStreamHeaderArray)>, pub on_succeeded: Option<extern "C" fn(stream: RawBidirectionalStream)>, pub on_failed: Option<extern "C" fn(stream: RawBidirectionalStream, net_error: i32)>, pub on_canceled: Option<extern "C" fn(stream: RawBidirectionalStream)>, }
Expand description

Raw callback struct for bidirectional_stream.

Field order and signatures mirror bidirectional_stream_callback in bidirectional_stream_c.h exactly. The C API does not pass a user-data argument — application state is associated through the stream’s annotation (passed to bidirectional_stream_create). on_read_completed and on_write_completed carry the data buffer pointer the C API was operating on.

Fields§

§on_stream_ready: Option<extern "C" fn(stream: RawBidirectionalStream)>

void (*on_stream_ready)(bidirectional_stream* stream)

§on_response_headers_received: Option<extern "C" fn(stream: RawBidirectionalStream, headers: *const RawBidirectionalStreamHeaderArray, negotiated_protocol: *const c_char)>

void (*on_response_headers_received)(bidirectional_stream*, const header_array*, const char*)

§on_read_completed: Option<extern "C" fn(stream: RawBidirectionalStream, data: *mut c_char, bytes_read: i32)>

void (*on_read_completed)(bidirectional_stream*, char* data, int bytes_read)

§on_write_completed: Option<extern "C" fn(stream: RawBidirectionalStream, data: *const c_char)>

void (*on_write_completed)(bidirectional_stream*, const char* data)

§on_response_trailers_received: Option<extern "C" fn(stream: RawBidirectionalStream, trailers: *const RawBidirectionalStreamHeaderArray)>

void (*on_response_trailers_received)(bidirectional_stream*, const header_array*)

§on_succeeded: Option<extern "C" fn(stream: RawBidirectionalStream)>

void (*on_succeded)(bidirectional_stream* stream) (note: C header spelling)

§on_failed: Option<extern "C" fn(stream: RawBidirectionalStream, net_error: i32)>

void (*on_failed)(bidirectional_stream* stream, int net_error)

§on_canceled: Option<extern "C" fn(stream: RawBidirectionalStream)>

void (*on_canceled)(bidirectional_stream* stream)

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.