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§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. 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