Skip to main content

Frame

Struct Frame 

Source
pub struct Frame {
    pub header: LwpHeader,
    pub payload: Option<Bytes>,
    pub frame_type: FrameType,
}

Fields§

§header: LwpHeader§payload: Option<Bytes>§frame_type: FrameType

Implementations§

Source§

impl Frame

Source

pub fn new_ingest( batch_id: u64, timestamp_ns: u64, record_count: u32, payload: Bytes, ) -> Self

Source

pub fn new_ingest_with_topic( batch_id: u64, timestamp_ns: u64, record_count: u32, payload: Bytes, topic_id: u32, ) -> Self

Source

pub fn new_ack(batch_id: u64) -> Self

Source

pub fn new_keepalive() -> Self

Source

pub fn new_backpressure() -> Self

Source

pub fn new_control(command: ControlCommand, payload: Option<Bytes>) -> Self

Source

pub fn new_create_topic(topic_name: &str) -> Self

Source

pub fn new_list_topics() -> Self

Source

pub fn new_get_topic(topic_id: u32) -> Self

Source

pub fn new_delete_topic(topic_id: u32) -> Self

Source

pub fn new_set_retention( topic_id: u32, max_age_secs: u64, max_bytes: u64, ) -> Self

Create a set retention policy request frame Payload format: topic_id(4) + max_age_secs(8) + max_bytes(8)

Source

pub fn new_create_topic_with_retention( topic_name: &str, max_age_secs: u64, max_bytes: u64, ) -> Self

Create a topic with retention configuration Payload format: name_len(2) + name(var) + max_age_secs(8) + max_bytes(8)

Source

pub fn new_fetch(topic_id: u32, start_offset: u64, max_bytes: u32) -> Self

Create a fetch request frame Payload format: topic_id(4) + start_offset(8) + max_bytes(4)

Source

pub fn new_fetch_response(payload: Bytes) -> Self

Source

pub fn new_catching_up(current_max_offset: u64) -> Self

Create a catching-up response frame indicating the server has not yet replicated to the requested offset. Payload contains the current max offset (8 bytes LE u64) so the client knows the server’s progress.

Source

pub fn new_get_cluster_status() -> Self

Create a get cluster status request frame

Source

pub fn new_cluster_status_response(payload: Bytes) -> Self

Create a cluster status response frame

Source

pub fn new_authenticate(token: &str) -> Self

Create an authenticate request frame Payload format: token (UTF-8 string bytes)

Source

pub fn new_authenticate_response(success: bool, message: Option<&str>) -> Self

Create an authenticate response frame Payload format: success(1) + optional message

Source

pub fn new_subscribe( topic_id: u32, start_offset: u64, max_batch_bytes: u32, consumer_id: u64, ) -> Self

Create a subscribe request frame Payload format: topic_id(4) + start_offset(8) + max_batch_bytes(4) + consumer_id(8)

Source

pub fn new_unsubscribe(topic_id: u32, consumer_id: u64) -> Self

Create an unsubscribe request frame Payload format: topic_id(4) + consumer_id(8)

Source

pub fn new_commit_offset(topic_id: u32, consumer_id: u64, offset: u64) -> Self

Create a commit offset request frame Payload format: topic_id(4) + consumer_id(8) + offset(8)

Source

pub fn new_subscribe_ack(consumer_id: u64, start_offset: u64) -> Self

Create a subscribe acknowledgment frame Payload format: consumer_id(8) + start_offset(8)

Source

pub fn new_commit_ack(consumer_id: u64, committed_offset: u64) -> Self

Create a commit offset acknowledgment frame Payload format: consumer_id(8) + committed_offset(8)

Source

pub fn new_topic_response(payload: Bytes) -> Self

Source

pub fn new_error_response(message: &str) -> Self

Source

pub fn batch_id(&self) -> u64

Source

pub fn payload_length(&self) -> u32

Source

pub fn record_count(&self) -> u32

Source

pub fn topic_id(&self) -> u32

Auto Trait Implementations§

§

impl !Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

§

impl UnwindSafe for Frame

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> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more