pub struct ProofStruct {
pub location: ProofLocation,
pub data: Vec<u8>,
}Expand description
On-chain Proof argument passed to ComposableCow::setRoot.
Bundles the proof location discriminant with location-specific data
(e.g. an IPFS CID, Swarm hash, or Waku message). Pass data: vec![] for
ProofLocation::Private or ProofLocation::Emitted.
Fields§
§location: ProofLocationWhere the Merkle proof is stored/communicated.
data: Vec<u8>Location-specific proof bytes (empty for private or emitted proofs).
Implementations§
Source§impl ProofStruct
impl ProofStruct
Sourcepub const fn new(location: ProofLocation, data: Vec<u8>) -> Self
pub const fn new(location: ProofLocation, data: Vec<u8>) -> Self
Construct a ProofStruct with the given location and data bytes.
§Arguments
location- Where the Merkle proof is stored or communicated.data- Location-specific proof bytes (empty for private or emitted proofs).
§Returns
A new ProofStruct instance.
Sourcepub const fn private() -> Self
pub const fn private() -> Self
A private proof (no location data needed).
§Returns
A ProofStruct with ProofLocation::Private and empty data.
Sourcepub const fn emitted() -> Self
pub const fn emitted() -> Self
An emitted proof (no location data needed — the proof is in the tx log).
§Returns
A ProofStruct with ProofLocation::Emitted and empty data.
Sourcepub const fn with_location(self, location: ProofLocation) -> Self
pub const fn with_location(self, location: ProofLocation) -> Self
Override the proof location.
§Returns
The modified ProofStruct with the updated location (builder pattern).
Sourcepub fn with_data(self, data: Vec<u8>) -> Self
pub fn with_data(self, data: Vec<u8>) -> Self
Override the location-specific proof data bytes.
§Returns
The modified ProofStruct with the updated data (builder pattern).
Sourcepub const fn is_private(&self) -> bool
pub const fn is_private(&self) -> bool
Returns true if the proof location is ProofLocation::Private.
§Returns
true if location is ProofLocation::Private, false otherwise.
Sourcepub const fn is_emitted(&self) -> bool
pub const fn is_emitted(&self) -> bool
Returns true if the proof location is ProofLocation::Emitted.
§Returns
true if location is ProofLocation::Emitted, false otherwise.
Sourcepub const fn is_swarm(&self) -> bool
pub const fn is_swarm(&self) -> bool
Returns true if the proof location is ProofLocation::Swarm.
§Returns
true if location is ProofLocation::Swarm, false otherwise.
Sourcepub const fn is_waku(&self) -> bool
pub const fn is_waku(&self) -> bool
Returns true if the proof location is ProofLocation::Waku.
§Returns
true if location is ProofLocation::Waku, false otherwise.
Sourcepub const fn is_ipfs(&self) -> bool
pub const fn is_ipfs(&self) -> bool
Returns true if the proof location is ProofLocation::Ipfs.
§Returns
true if location is ProofLocation::Ipfs, false otherwise.
Sourcepub const fn is_reserved(&self) -> bool
pub const fn is_reserved(&self) -> bool
Returns true if the proof location is ProofLocation::Reserved.
§Returns
true if location is ProofLocation::Reserved, false otherwise.
Sourcepub const fn has_data(&self) -> bool
pub const fn has_data(&self) -> bool
Returns true if this proof has non-empty data bytes.
ProofLocation::Private and ProofLocation::Emitted proofs carry no
data; IPFS, Swarm, and Waku proofs carry location-specific bytes.
Trait Implementations§
Source§impl Clone for ProofStruct
impl Clone for ProofStruct
Source§fn clone(&self) -> ProofStruct
fn clone(&self) -> ProofStruct
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProofStruct
impl Debug for ProofStruct
Auto Trait Implementations§
impl Freeze for ProofStruct
impl RefUnwindSafe for ProofStruct
impl Send for ProofStruct
impl Sync for ProofStruct
impl Unpin for ProofStruct
impl UnsafeUnpin for ProofStruct
impl UnwindSafe for ProofStruct
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§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 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.