pub struct TransactionInput {
pub input: Option<Bytes>,
pub data: Option<Bytes>,
}
eth
only.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 const fn new(data: Bytes) -> TransactionInput
pub const fn new(data: Bytes) -> TransactionInput
Creates a new instance with the given input data.
sourcepub fn both(data: Bytes) -> TransactionInput
pub fn both(data: Bytes) -> TransactionInput
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>) -> TransactionInput
pub const fn maybe_input(input: Option<Bytes>) -> TransactionInput
Creates a new instance with the given input data.
sourcepub fn maybe_both(input: Option<Bytes>) -> TransactionInput
pub fn maybe_both(input: Option<Bytes>) -> TransactionInput
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<'arbitrary> Arbitrary<'arbitrary> for TransactionInput
impl<'arbitrary> Arbitrary<'arbitrary> for TransactionInput
source§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<TransactionInput, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<TransactionInput, Error>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<TransactionInput, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<TransactionInput, Error>
Self
from the entirety of the given
unstructured data. Read moresource§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<TransactionInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<Bytes> for TransactionInput
impl From<Bytes> for TransactionInput
source§fn from(input: Bytes) -> TransactionInput
fn from(input: Bytes) -> TransactionInput
source§impl Hash for TransactionInput
impl Hash for TransactionInput
source§impl PartialEq for TransactionInput
impl PartialEq for TransactionInput
source§impl Serialize for TransactionInput
impl Serialize for TransactionInput
source§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,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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§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