Struct TransactionBundle
pub struct TransactionBundle<T>where
T: TransactionType,{
pub transactions: Vec<SignedTransaction<T>>,
}Expand description
A bundle of (signed) transactions of type T.
Fields§
§transactions: Vec<SignedTransaction<T>>Collection of transactions.
Implementations§
§impl<T> TransactionBundle<T>where
T: TransactionType,
impl<T> TransactionBundle<T>where
T: TransactionType,
pub const fn new(
transactions: Vec<SignedTransaction<T>>,
) -> TransactionBundle<T>
pub const fn new( transactions: Vec<SignedTransaction<T>>, ) -> TransactionBundle<T>
Creates a new bundle with the given transactions.
pub const fn empty() -> TransactionBundle<T>
pub const fn empty() -> TransactionBundle<T>
Creates a new empty bundle.
pub fn add_transaction(&mut self, transaction: SignedTransaction<T>)
pub fn add_transaction(&mut self, transaction: SignedTransaction<T>)
Adds a transaction to the bundle.
pub fn add_transactions(
&mut self,
transactions: impl IntoIterator<Item = SignedTransaction<T>>,
)
pub fn add_transactions( &mut self, transactions: impl IntoIterator<Item = SignedTransaction<T>>, )
Adds a sequence of transactions to the bundle.
pub fn validate(&mut self) -> Vec<(HashDigest, TransactionValidationError)>
pub fn validate(&mut self) -> Vec<(HashDigest, TransactionValidationError)>
Run self-validations for each transaction in the bundle, removing transactions from the bundle if they fail the validation. The removed transactions are returned with the corresponding error.
Trait Implementations§
§impl<T> Clone for TransactionBundle<T>where
T: Clone + TransactionType,
impl<T> Clone for TransactionBundle<T>where
T: Clone + TransactionType,
§fn clone(&self) -> TransactionBundle<T>
fn clone(&self) -> TransactionBundle<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<T> Debug for TransactionBundle<T>where
T: Debug + TransactionType,
impl<T> Debug for TransactionBundle<T>where
T: Debug + TransactionType,
§impl<T> Default for TransactionBundle<T>where
T: TransactionType,
impl<T> Default for TransactionBundle<T>where
T: TransactionType,
§fn default() -> TransactionBundle<T>
fn default() -> TransactionBundle<T>
Returns the “default value” for a type. Read more
§impl<'de, T> Deserialize<'de> for TransactionBundle<T>where
T: TransactionType + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for TransactionBundle<T>where
T: TransactionType + Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionBundle<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionBundle<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<T> FromIterator<SignedTransaction<T>> for TransactionBundle<T>where
T: TransactionType,
impl<T> FromIterator<SignedTransaction<T>> for TransactionBundle<T>where
T: TransactionType,
§fn from_iter<I>(iter: I) -> TransactionBundle<T>where
I: IntoIterator<Item = SignedTransaction<T>>,
fn from_iter<I>(iter: I) -> TransactionBundle<T>where
I: IntoIterator<Item = SignedTransaction<T>>,
Creates a value from an iterator. Read more
§impl<T> PartialEq for TransactionBundle<T>where
T: PartialEq + TransactionType,
impl<T> PartialEq for TransactionBundle<T>where
T: PartialEq + TransactionType,
§impl<T> Serialize for TransactionBundle<T>where
T: TransactionType + Serialize,
impl<T> Serialize for TransactionBundle<T>where
T: TransactionType + Serialize,
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for TransactionBundle<T>where
T: Eq + TransactionType,
impl<T> StructuralPartialEq for TransactionBundle<T>where
T: TransactionType,
Auto Trait Implementations§
impl<T> Freeze for TransactionBundle<T>
impl<T> RefUnwindSafe for TransactionBundle<T>where
T: RefUnwindSafe,
impl<T> Send for TransactionBundle<T>where
T: Send,
impl<T> Sync for TransactionBundle<T>where
T: Sync,
impl<T> Unpin for TransactionBundle<T>where
T: Unpin,
impl<T> UnwindSafe for TransactionBundle<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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