Skip to main content

BuildRequestInput

Struct BuildRequestInput 

Source
pub struct BuildRequestInput<'a> {
    pub method: &'a str,
    pub path: &'a str,
    pub raw_query: &'a str,
    pub canonical_body: &'a str,
    pub nonce: &'a str,
    pub context_id: &'a str,
    pub timestamp: &'a str,
    pub scope: Option<&'a [&'a str]>,
    pub previous_proof: Option<&'a str>,
}
Expand description

Input for high-level request proof building.

The client SDK is responsible for:

  • Obtaining nonce and context_id from the server
  • Canonicalizing the body (based on content type)
  • Generating a current timestamp

The builder handles everything else: nonce validation, timestamp validation, binding normalization, body hashing, secret derivation, and proof computation.

Fields§

§method: &'a str

HTTP method (e.g., “POST”, “GET”)

§path: &'a str

URL path without query string (e.g., “/api/transfer”)

§raw_query: &'a str

Raw query string without leading ? (e.g., “page=1&sort=name”)

§canonical_body: &'a str

Canonicalized body string (caller canonicalizes based on content type)

§nonce: &'a str

Server nonce (from context response)

§context_id: &'a str

Context ID (from context response)

§timestamp: &'a str

Unix timestamp as string (caller generates current time)

§scope: Option<&'a [&'a str]>

Optional: scope fields for scoped proof (e.g., &[“amount”, “recipient”])

§previous_proof: Option<&'a str>

Optional: previous proof hex for request chaining

Trait Implementations§

Source§

impl<'a> Debug for BuildRequestInput<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BuildRequestInput<'a>

§

impl<'a> RefUnwindSafe for BuildRequestInput<'a>

§

impl<'a> Send for BuildRequestInput<'a>

§

impl<'a> Sync for BuildRequestInput<'a>

§

impl<'a> Unpin for BuildRequestInput<'a>

§

impl<'a> UnsafeUnpin for BuildRequestInput<'a>

§

impl<'a> UnwindSafe for BuildRequestInput<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.