pub struct Request { /* private fields */ }Expand description
What the client asked for, for the binding of 5.5 step 5.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(cell_id: &str, asof: Option<&str>) -> Result<Request, InvalidRequest>
pub fn new(cell_id: &str, asof: Option<&str>) -> Result<Request, InvalidRequest>
A request for the cell with id cell_id (64 lowercase hex digits) as of asof (an
instant) or now. Anything else is InvalidRequest: SPEC 5.5 makes a malformed
request the caller’s error, reported outside the E_* codes.
Sourcepub fn with_job(
cell_id: &str,
asof: Option<&str>,
job: &str,
) -> Result<Request, InvalidRequest>
pub fn with_job( cell_id: &str, asof: Option<&str>, job: &str, ) -> Result<Request, InvalidRequest>
The request description for GET of a job’s poll URL (5.5, spec-0.4.1): the
original request (cell_id, asof) and the job polled, 32 to 64 lowercase hex digits
(otherwise InvalidRequest). With it, an envelope may be bad_request with
E_JOB_UNKNOWN, and a pending one must carry this job; any other answer is bound
to the original request, as a /cell answer is.
Sourcepub fn with_pin(self, fn_hash: &str) -> Result<Request, InvalidRequest>
pub fn with_pin(self, fn_hash: &str) -> Result<Request, InvalidRequest>
The same request, pinned to the function fn_hash (64 lowercase hex digits; otherwise
InvalidRequest): the answer must echo it (5.5, spec-0.4.2). cell_id is then the
id of the cell of that function.
Sourcepub fn with_mesh(self, host: &str) -> Result<Request, InvalidRequest>
pub fn with_mesh(self, host: &str) -> Result<Request, InvalidRequest>
The same request, naming the host it was sent to (a DNS name; otherwise
InvalidRequest): computed is then checked against the receipt’s signer, and
poll against the host (5.5, spec-0.4.2). Without it those checks are the caller’s.
Sourcepub fn fn_hash(&self) -> Option<&str>
pub fn fn_hash(&self) -> Option<&str>
The pin, for a pinned request (Request::with_pin).
Sourcepub fn mesh(&self) -> Option<&str>
pub fn mesh(&self) -> Option<&str>
The host the request was sent to, when given (Request::with_mesh).
Sourcepub fn job(&self) -> Option<&str>
pub fn job(&self) -> Option<&str>
The job polled, for a request made at a job URL (Request::with_job).