pub struct Withdrawal { /* private fields */ }Expand description
A withdrawal (8.1, spec-0.7.0, R1): the null version of a stored cell. The cell has no value from its
asof on, and withdrawn says why. It has withdrawn in place of type and value, and inputs is
empty. It is signed and verified like a stored receipt, and it is never a Receipt: a Receipt
always holds a value. Parsed by Withdrawal::from_json; verified by crate::verify; answered as
not_covered with the withdrawn member of an envelope (crate::Answer::withdrawn).
Implementations§
Source§impl Withdrawal
impl Withdrawal
Sourcepub fn from_json(bytes: &[u8]) -> Result<Withdrawal>
pub fn from_json(bytes: &[u8]) -> Result<Withdrawal>
Parses a withdrawal and runs verification steps 1-4 (10.1). A receipt with a value is refused (E_SCHEMA).
Sourcepub fn from_value(v: &Value) -> Result<Withdrawal>
pub fn from_value(v: &Value) -> Result<Withdrawal>
Runs verification steps 2-4 on a parsed JSON value.
Sourcepub fn canonical(&self) -> &[u8] ⓘ
pub fn canonical(&self) -> &[u8] ⓘ
The canonical bytes of the whole withdrawal, sig included (JCS, as on the wire).
Sourcepub fn computed_by(&self) -> &str
pub fn computed_by(&self) -> &str
<host>#<key id> of the signing key.
Sourcepub fn withdrawn(&self) -> &str
pub fn withdrawn(&self) -> &str
The reason: the withdrawn member, a non-empty string under the summary limit.
Sourcepub fn signer_host(&self) -> &str
pub fn signer_host(&self) -> &str
The host of computed_by.