pub struct Forms {
pub request: FormType,
pub response: FormType,
pub summary: Option<FormType>,
pub error: Option<FormType>,
}Expand description
An operation’s types as its forms carry them (core §5.1, §5.2).
Fields§
§request: FormType§response: FormType§summary: Option<FormType>replies = "many"’s declared summary, if any (O6).
error: Option<FormType>The declared error type, if any: an app error’s detail is a value
of it.
Implementations§
Source§impl Forms
impl Forms
Sourcepub fn of(contract: &Contract, op: &Operation) -> Result<Forms, String>
pub fn of(contract: &Contract, op: &Operation) -> Result<Forms, String>
op’s forms, its types read in contract (FormType::of).
§Errors
A packed type of op whose layout does not resolve.
Sourcepub fn error_tag(&self) -> Tag
pub fn error_tag(&self) -> Tag
CH’s tag on an error: the error type’s, 0 when it declares none.
Sourcepub fn request(&self, record: &[u8]) -> Vec<u8> ⓘ
pub fn request(&self, record: &[u8]) -> Vec<u8> ⓘ
A request’s bytes, the caller’s (§5.1): CH · record, its width bit
0 and its tag the request type’s.
Sourcepub fn value(&self, mark: Stamp, record: &[u8]) -> Vec<u8> ⓘ
pub fn value(&self, mark: Stamp, record: &[u8]) -> Vec<u8> ⓘ
A value reply’s bytes, the owner’s (§5.1): the value form, its tag
the response type’s, with the replying instance’s as-of mark.
Sourcepub fn summary(&self, mark: Stamp, record: &[u8]) -> Option<Vec<u8>>
pub fn summary(&self, mark: Stamp, record: &[u8]) -> Option<Vec<u8>>
A summary reply’s bytes (O6): the value form under the summary
type’s tag. None for an operation that declares no summary.
Sourcepub fn error(
&self,
mark: Stamp,
code: Code,
cause: Option<Cause>,
message: Option<&str>,
detail: Option<&[u8]>,
) -> Result<Vec<u8>, WriteRefusal>
pub fn error( &self, mark: Stamp, code: Code, cause: Option<Cause>, message: Option<&str>, detail: Option<&[u8]>, ) -> Result<Vec<u8>, WriteRefusal>
An error reply’s bytes, the owner’s (§5.2): the error form, its tag
the error type’s or 0, with the replying instance’s as-of mark. A
message is cut at 255 bytes (§7.5); detail is the bytes of a value
of the error type, as that type encodes it.
§Errors
WriteRefusal::Undeclared for a detail on an operation that
declares no error type, else §7.5’s writer’s refusal: a cause on a
code other than unavailable or none on it (cause), a detail on a
code other than app (detail).
Sourcepub fn read_request<'a>(
&self,
payload: &'a [u8],
) -> Result<Request<'a>, RequestRefusal>
pub fn read_request<'a>( &self, payload: &'a [u8], ) -> Result<Request<'a>, RequestRefusal>
A query’s payload read as this operation’s request, as its owner reads it (§5.1, “The request”): §7.5’s parse, then a packed record under CH’s tag. Any other kind’s record is its type’s decoder’s.
§Errors
The first refusal: §7.5’s (RequestRefusal::Form: short,
form, sample_kind, request_run), then §7.6’s
(RequestRefusal::Record: tag, length, code, extension,
pad).
Trait Implementations§
impl Eq for Forms
impl StructuralPartialEq for Forms
Auto Trait Implementations§
impl Forget for Forms
impl Freeze for Forms
impl Move for Forms
impl RefUnwindSafe for Forms
impl Send for Forms
impl Sync for Forms
impl Unpin for Forms
impl UnsafeUnpin for Forms
impl UnwindSafe for Forms
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more