pub struct KinesisPublisher { /* private fields */ }Expand description
Publishes records to Kinesis streams; the destination is the stream’s name.
The record’s partition key is the unit of shard routing and per-key ordering. A publish names
it with partition_key on the publish builder; a record
that names none takes the key the mount site named on the policy
(KinesisPublish::partition_key), and without that a process-unique key spreads the records
across the shards. User headers beyond the partition key travel in a small conditional envelope
(Kinesis records carry only a data blob and a partition key); plain payloads stay unenveloped,
so any Kinesis consumer reads them, and a record from another producer reads back as
headerless. The envelope is the magic RSK2, a big-endian u32 length of the header block,
the block, and the payload; each header is a u32-prefixed name and a u32-prefixed value,
so a value comes back byte for byte. Records in the earlier RSK1 text envelope still read
back with their headers. One publish is one PutRecord call.
Buildable before connect and usable until shutdown; afterwards every publish reports
KinesisError::NotConnected.
Trait Implementations§
Source§impl Clone for KinesisPublisher
impl Clone for KinesisPublisher
Source§impl Debug for KinesisPublisher
impl Debug for KinesisPublisher
Source§impl Publisher for KinesisPublisher
impl Publisher for KinesisPublisher
Source§type Payload = Take
type Payload = Take
A record’s data is a Blob, a vector the client keeps for the request, so the publisher
takes the buffer the framework wrote: a publish that carries no header hands it straight
through, and one that does spends it as the body of the envelope.
Source§type Options = KinesisPublishOptions
type Options = KinesisPublishOptions
The partition key is the one setting a Kinesis record varies per message, and
KinesisPublishSteps is where a call site sets it.
Source§type Error = KinesisError
type Error = KinesisError
publish.Auto Trait Implementations§
impl !RefUnwindSafe for KinesisPublisher
impl !UnwindSafe for KinesisPublisher
impl Freeze for KinesisPublisher
impl Send for KinesisPublisher
impl Sync for KinesisPublisher
impl Unpin for KinesisPublisher
impl UnsafeUnpin for KinesisPublisher
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> PublishExt for P
impl<P> PublishExt for P
Source§fn message<'a, T>(
&'a self,
value: &'a T,
) -> PublishBuilder<&'a Self, MessageBody<'a, T>, UnnamedCodec, HeadersUnset, <T as OutgoingDestination>::Form>where
T: OutgoingDestination,
fn message<'a, T>(
&'a self,
value: &'a T,
) -> PublishBuilder<&'a Self, MessageBody<'a, T>, UnnamedCodec, HeadersUnset, <T as OutgoingDestination>::Form>where
T: OutgoingDestination,
#[derive(Outgoing)] value, encoded with the crate’s
default codec (name another one with with_codec(..)). A
Serialized value’s bytes leave as they are instead - the wire is
the type’s own (MessageWire), and no codec runs on it. Read moreSource§fn begin(
&self,
) -> impl Future<Output = Result<TransactionScope<'_, Self, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + TransactionalPublisher,
fn begin(
&self,
) -> impl Future<Output = Result<TransactionScope<'_, Self, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + TransactionalPublisher,
TransactionScope that
owns it. Read moreSource§fn owned_transaction(
&self,
) -> impl Future<Output = Result<TypedTransaction<Self::Transaction, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + OwnedTransactions,
fn owned_transaction(
&self,
) -> impl Future<Output = Result<TypedTransaction<Self::Transaction, UnnamedCodec, AnyDeclared>, Self::Error>> + Sendwhere
Self: Sized + OwnedTransactions,
TypedTransaction that owns it. Read more