Struct dynamo_subscriber::types::Shard
source · 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>) -> Self
pub fn set_iterator(self, iterator: Option<String>) -> Self
Return Shard with passed shard iterator id.
Trait Implementations§
Auto Trait Implementations§
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> 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>
Creates a shared type from an unshared type.