pub struct RecipientList(/* private fields */);Expand description
A validated batch of recipients enforcing both PCS quotas and SDK invariants:
- Non-empty: at least one recipient (PCS rejects empty batches).
- At most 1,000: PCS External API limit per send request.
- Deduplicated by ppnum: avoids paying for two deliveries to the same recipient if the caller’s caller passed dupes.
Construct via Self::try_new; the only unchecked path is
From<Vec<Recipient>> which is intentionally not provided.
Implementations§
Source§impl RecipientList
impl RecipientList
Sourcepub fn try_new(recipients: Vec<Recipient>) -> Result<Self, RecipientListError>
pub fn try_new(recipients: Vec<Recipient>) -> Result<Self, RecipientListError>
Validate and dedupe a recipient batch.
Dedup is by Ppnum equality, preserving first-occurrence order.
The deduped count must be in 1..=1000.
§Errors
Returns RecipientListError::Empty when the input is empty,
RecipientListError::TooLarge when the deduped result still
exceeds 1,000 entries.
Sourcepub fn from_ppnums(ppnums: Vec<Ppnum>) -> Result<Self, RecipientListError>
pub fn from_ppnums(ppnums: Vec<Ppnum>) -> Result<Self, RecipientListError>
Convenience constructor for the common case where only ppnums are needed and templates require no per-recipient variables.
§Errors
Same as Self::try_new.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for RecipientList
impl Clone for RecipientList
Source§fn clone(&self) -> RecipientList
fn clone(&self) -> RecipientList
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RecipientList
impl Debug for RecipientList
Source§impl<'a> IntoIterator for &'a RecipientList
impl<'a> IntoIterator for &'a RecipientList
Auto Trait Implementations§
impl Freeze for RecipientList
impl RefUnwindSafe for RecipientList
impl Send for RecipientList
impl Sync for RecipientList
impl Unpin for RecipientList
impl UnsafeUnpin for RecipientList
impl UnwindSafe for RecipientList
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request