pub struct Frame {
pub header: LwpHeader,
pub payload: Option<Bytes>,
pub frame_type: FrameType,
}Fields§
§header: LwpHeader§payload: Option<Bytes>§frame_type: FrameTypeImplementations§
Source§impl Frame
impl Frame
pub fn new_ingest( batch_id: u64, timestamp_ns: u64, record_count: u32, payload: Bytes, ) -> Self
pub fn new_ingest_with_topic( batch_id: u64, timestamp_ns: u64, record_count: u32, payload: Bytes, topic_id: u32, ) -> Self
pub fn new_ack(batch_id: u64) -> Self
pub fn new_keepalive() -> Self
pub fn new_backpressure() -> Self
pub fn new_control(command: ControlCommand, payload: Option<Bytes>) -> Self
pub fn new_create_topic(topic_name: &str) -> Self
pub fn new_list_topics() -> Self
pub fn new_get_topic(topic_id: u32) -> Self
pub fn new_delete_topic(topic_id: u32) -> Self
Sourcepub fn new_set_retention(
topic_id: u32,
max_age_secs: u64,
max_bytes: u64,
) -> Self
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)
Sourcepub fn new_create_topic_with_retention(
topic_name: &str,
max_age_secs: u64,
max_bytes: u64,
) -> Self
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)
Sourcepub fn new_fetch(topic_id: u32, start_offset: u64, max_bytes: u32) -> Self
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)
pub fn new_fetch_response(payload: Bytes) -> Self
Sourcepub fn new_catching_up(current_max_offset: u64) -> Self
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.
Sourcepub fn new_get_cluster_status() -> Self
pub fn new_get_cluster_status() -> Self
Create a get cluster status request frame
Sourcepub fn new_cluster_status_response(payload: Bytes) -> Self
pub fn new_cluster_status_response(payload: Bytes) -> Self
Create a cluster status response frame
Sourcepub fn new_authenticate(token: &str) -> Self
pub fn new_authenticate(token: &str) -> Self
Create an authenticate request frame Payload format: token (UTF-8 string bytes)
Sourcepub fn new_authenticate_response(success: bool, message: Option<&str>) -> Self
pub fn new_authenticate_response(success: bool, message: Option<&str>) -> Self
Create an authenticate response frame Payload format: success(1) + optional message
Sourcepub fn new_subscribe(
topic_id: u32,
start_offset: u64,
max_batch_bytes: u32,
consumer_id: u64,
) -> Self
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)
Sourcepub fn new_unsubscribe(topic_id: u32, consumer_id: u64) -> Self
pub fn new_unsubscribe(topic_id: u32, consumer_id: u64) -> Self
Create an unsubscribe request frame Payload format: topic_id(4) + consumer_id(8)
Sourcepub fn new_commit_offset(topic_id: u32, consumer_id: u64, offset: u64) -> Self
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)
Sourcepub fn new_subscribe_ack(consumer_id: u64, start_offset: u64) -> Self
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)
Sourcepub fn new_commit_ack(consumer_id: u64, committed_offset: u64) -> Self
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)
pub fn new_topic_response(payload: Bytes) -> Self
pub fn new_error_response(message: &str) -> Self
pub fn batch_id(&self) -> u64
pub fn payload_length(&self) -> u32
pub fn record_count(&self) -> u32
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request