pub struct Shard { /* private fields */ }Expand description
A shard representation to retreive DynamoDB Streams records.
Implementations§
Source§impl Shard
impl Shard
Sourcepub fn new(shard: Shard) -> Option<Self>
pub fn new(shard: Shard) -> Option<Self>
Create a new shard from
aws_sdk_dynamodbstreams::types::Shard.
If the input’s shard_id is None, this method also returns None.
use aws_sdk_dynamodbstreams as dynamodbstreams;
use dynamo_subscriber::types::Shard;
// Create a aws_sdk_dynamodbstreams's Shard with shard_id
let original = dynamodbstreams::types::Shard::builder()
.shard_id("0001")
.build();
assert!(original.shard_id().is_some());
// This case, the shard should exist.
let shard = Shard::new(original);
assert!(shard.is_some());
// Create a aws_sdk_dynamodbstreams's Shard without shard_id
let original = dynamodbstreams::types::Shard::builder()
.build();
assert!(original.shard_id().is_none());
// This case, the shard should not exist.
let shard = Shard::new(original);
assert!(shard.is_none());Sourcepub fn parent_shard_id(&self) -> Option<&str>
pub fn parent_shard_id(&self) -> Option<&str>
Return the parent shard id.
Sourcepub fn set_iterator(self, iterator: Option<String>) -> Option<Self>
pub fn set_iterator(self, iterator: Option<String>) -> Option<Self>
Return Option<Shard> with passed shard iterator id.
Setting None as the shard iterator means the shard drops because None shard iterator will
get no records from the DynamoDB Table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shard
impl RefUnwindSafe for Shard
impl Send for Shard
impl Sync for Shard
impl Unpin for Shard
impl UnwindSafe for Shard
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.