⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

GrpcTransport

Struct GrpcTransport 

Source
pub struct GrpcTransport { /* private fields */ }
Expand description

Unix socket-based gRPC transport.

Implementations§

Source§

impl GrpcTransport

Source

pub const DEFAULT_MAX_FRAME_SIZE: u32 = 16_384u32

Default maximum HTTP/2 frame size (16 KiB).

Source

pub const DEFAULT_WINDOW_SIZE: u32 = 65_535u32

Default window size (64 KiB).

Source

pub fn new(socket_path: String) -> Self

Create a new gRPC transport targeting a Unix socket.

Source

pub fn socket_path(&self) -> &str

Get the socket path.

Source

pub fn next_stream(&mut self) -> u32

Allocate the next client stream ID (always odd).

Source

pub fn build_request_frame(&mut self, msg: &GrpcMessage) -> Http2Frame

Build a DATA frame containing a gRPC-encoded message.

Source

pub fn parse_response_frame(frame: &Http2Frame) -> Option<GrpcResponse>

Parse a gRPC response from an HTTP/2 DATA frame.

Source

pub fn window_size(&self) -> u32

Get the current window size.

Source

pub fn update_window(&mut self, delta: u32)

Update window size by a delta.

Source

pub fn consume_window(&mut self, amount: u32) -> bool

Consume window for a send operation.

Trait Implementations§

Source§

impl Debug for GrpcTransport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for GrpcTransport

§

impl RefUnwindSafe for GrpcTransport

§

impl Send for GrpcTransport

§

impl Sync for GrpcTransport

§

impl Unpin for GrpcTransport

§

impl UnwindSafe for GrpcTransport

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.