pub struct Withheld {
pub withheld: String,
pub bytes: usize,
pub limit: usize,
pub itself: String,
}Expand description
What an event carries in place of a value too large for one frame: why it was withheld, how large it is, and where the whole value is read.
The event is still the same typed event, with its sequence, so nothing about the execution’s story is lost — only the value is read elsewhere, from the snapshot.
use majordomus_cli::http::events::Withheld;
let w = Withheld {
withheld: "too_large".into(),
bytes: 2_000_000,
limit: 1_048_576,
itself: "/api/v1/executions/get?id=e1".into(),
};
let json = serde_json::to_value(&w).unwrap();
assert_eq!(json["self"], "/api/v1/executions/get?id=e1", "the reference is `self` on the wire");
assert!(json.get("itself").is_none());
assert_eq!(serde_json::from_value::<Withheld>(json).unwrap(), w);Fields§
§withheld: StringWhy: always too_large.
bytes: usizeThe size of the value as JSON, in bytes.
limit: usizeThe largest frame this server writes, ws::MAX_FRAME_BYTES.
itself: StringThe snapshot that carries the whole value: GET /api/v1/executions/get?id=….
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Withheld
impl<'de> Deserialize<'de> for Withheld
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Withheld
Source§impl JsonSchema for Withheld
impl JsonSchema for Withheld
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Withheld
Auto Trait Implementations§
impl Freeze for Withheld
impl RefUnwindSafe for Withheld
impl Send for Withheld
impl Sync for Withheld
impl Unpin for Withheld
impl UnsafeUnpin for Withheld
impl UnwindSafe for Withheld
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
Mutably borrows from an owned value. Read more
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.