Struct alloy_rpc_types_eth::transaction::request::TransactionInput
source · pub struct TransactionInput {
pub input: Option<Bytes>,
pub data: Option<Bytes>,
}
Expand description
Helper type that supports both data
and input
fields that map to transaction input data.
This is done for compatibility reasons where older implementations used data
instead of the
newer, recommended input
field.
If both fields are set, it is expected that they contain the same value, otherwise an error is returned.
Fields§
§input: Option<Bytes>
Transaction data
data: Option<Bytes>
Transaction data
This is the same as input
but is used for backwards compatibility: https://github.com/ethereum/go-ethereum/issues/15628
Implementations§
source§impl TransactionInput
impl TransactionInput
sourcepub fn both(data: Bytes) -> Self
pub fn both(data: Bytes) -> Self
Creates a new instance with the given input data and sets both input
and data
fields to
the same value.
sourcepub const fn maybe_input(input: Option<Bytes>) -> Self
pub const fn maybe_input(input: Option<Bytes>) -> Self
Creates a new instance with the given input data.
sourcepub fn maybe_both(input: Option<Bytes>) -> Self
pub fn maybe_both(input: Option<Bytes>) -> Self
Creates a new instance with the given input data and sets both input
and data
fields to
the same value.
sourcepub fn into_input(self) -> Option<Bytes>
pub fn into_input(self) -> Option<Bytes>
Consumes the type and returns the optional input data.
sourcepub fn try_into_unique_input(
self,
) -> Result<Option<Bytes>, TransactionInputError>
pub fn try_into_unique_input( self, ) -> Result<Option<Bytes>, TransactionInputError>
Consumes the type and returns the optional input data.
Returns an error if both data
and input
fields are set and not equal.
sourcepub fn unique_input(&self) -> Result<Option<&Bytes>, TransactionInputError>
pub fn unique_input(&self) -> Result<Option<&Bytes>, TransactionInputError>
Returns the optional input data.
Returns an error if both data
and input
fields are set and not equal.
Trait Implementations§
source§impl Clone for TransactionInput
impl Clone for TransactionInput
source§fn clone(&self) -> TransactionInput
fn clone(&self) -> TransactionInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransactionInput
impl Debug for TransactionInput
source§impl Default for TransactionInput
impl Default for TransactionInput
source§fn default() -> TransactionInput
fn default() -> TransactionInput
source§impl<'de> Deserialize<'de> for TransactionInput
impl<'de> Deserialize<'de> for TransactionInput
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<Bytes> for TransactionInput
impl From<Bytes> for TransactionInput
source§impl Hash for TransactionInput
impl Hash for TransactionInput
source§impl PartialEq for TransactionInput
impl PartialEq for TransactionInput
source§fn eq(&self, other: &TransactionInput) -> bool
fn eq(&self, other: &TransactionInput) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TransactionInput
impl Serialize for TransactionInput
impl Eq for TransactionInput
impl StructuralPartialEq for TransactionInput
Auto Trait Implementations§
impl !Freeze for TransactionInput
impl RefUnwindSafe for TransactionInput
impl Send for TransactionInput
impl Sync for TransactionInput
impl Unpin for TransactionInput
impl UnwindSafe for TransactionInput
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
key
and return true
if they are equal.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 more