pub struct WrapperEntry {
pub wrapper_address: String,
pub wrapper_data: Option<String>,
pub is_omittable: Option<bool>,
}Expand description
A single token wrapper entry.
Fields§
§wrapper_address: StringAddress of the wrapper contract.
wrapper_data: Option<String>Optional wrapper-specific data.
is_omittable: Option<bool>Whether this wrapper can be omitted if not needed.
Implementations§
Source§impl WrapperEntry
impl WrapperEntry
Sourcepub fn new(wrapper_address: impl Into<String>) -> Self
pub fn new(wrapper_address: impl Into<String>) -> Self
Construct a WrapperEntry with just the wrapper contract address.
Wrapper entries describe token wrapping/unwrapping operations applied during order execution (e.g. WETH ↔ ETH).
§Parameters
wrapper_address—0x-prefixed address of the wrapper contract.
§Returns
A new WrapperEntry with wrapper_data and is_omittable unset.
§Example
use cow_rs::app_data::types::WrapperEntry;
let w = WrapperEntry::new("0xWrapperContract").with_is_omittable(true);
assert!(w.is_omittable());Sourcepub fn with_wrapper_data(self, data: impl Into<String>) -> Self
pub fn with_wrapper_data(self, data: impl Into<String>) -> Self
Sourcepub const fn with_is_omittable(self, omittable: bool) -> Self
pub const fn with_is_omittable(self, omittable: bool) -> Self
Sourcepub const fn has_wrapper_data(&self) -> bool
pub const fn has_wrapper_data(&self) -> bool
Returns true if wrapper-specific data is attached.
Sourcepub const fn has_is_omittable(&self) -> bool
pub const fn has_is_omittable(&self) -> bool
Returns true if the omittable flag is explicitly set.
Sourcepub const fn is_omittable(&self) -> bool
pub const fn is_omittable(&self) -> bool
Returns true if this wrapper is explicitly marked as omittable.
Trait Implementations§
Source§impl Clone for WrapperEntry
impl Clone for WrapperEntry
Source§fn clone(&self) -> WrapperEntry
fn clone(&self) -> WrapperEntry
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 moreSource§impl Debug for WrapperEntry
impl Debug for WrapperEntry
Source§impl<'de> Deserialize<'de> for WrapperEntry
impl<'de> Deserialize<'de> for WrapperEntry
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WrapperEntry
impl Display for WrapperEntry
Auto Trait Implementations§
impl Freeze for WrapperEntry
impl RefUnwindSafe for WrapperEntry
impl Send for WrapperEntry
impl Sync for WrapperEntry
impl Unpin for WrapperEntry
impl UnsafeUnpin for WrapperEntry
impl UnwindSafe for WrapperEntry
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> 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>
Converts
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>
Converts
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.