pub enum CanisterHttpReplication {
FullyReplicated,
NonReplicated,
Flexible {
total_requests: u32,
min_responses: u32,
max_responses: u32,
},
}Expand description
How a canister HTTP outcall is replicated across the nodes of its subnet.
Variants§
FullyReplicated
Every node of the subnet performs the outcall and a response is delivered
once n - f of them agree on it. Too many differing responses make the
outcall fail with a “no consensus could be reached” rejection instead.
Mock such an outcall with PocketIc::mock_canister_http_response, whose
additional_responses are what lets a test produce either outcome.
NonReplicated
One node of the subnet performs the outcall (is_replicated = false) and
its response is the one delivered. PocketIC does not report which node was
picked, so mock such an outcall with
PocketIc::mock_canister_http_response like a fully replicated one: give it
a single response, which every node then reports, and it is delivered no
matter which node was picked. Differing additional_responses would instead
make the delivered response unpredictable.
Flexible
A committee of total_requests nodes performs the outcall and between
min_responses and max_responses of their (potentially differing)
responses are delivered to the calling canister. Mock such an outcall
with PocketIc::mock_flexible_canister_http_response.
Trait Implementations§
Source§impl Clone for CanisterHttpReplication
impl Clone for CanisterHttpReplication
Source§impl Debug for CanisterHttpReplication
impl Debug for CanisterHttpReplication
Source§impl<'de> Deserialize<'de> for CanisterHttpReplication
impl<'de> Deserialize<'de> for CanisterHttpReplication
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>,
impl Eq for CanisterHttpReplication
Source§impl Hash for CanisterHttpReplication
impl Hash for CanisterHttpReplication
Source§impl JsonSchema for CanisterHttpReplication
impl JsonSchema for CanisterHttpReplication
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Ord for CanisterHttpReplication
impl Ord for CanisterHttpReplication
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CanisterHttpReplication
impl PartialEq for CanisterHttpReplication
Source§impl PartialOrd for CanisterHttpReplication
impl PartialOrd for CanisterHttpReplication
Source§impl Serialize for CanisterHttpReplication
impl Serialize for CanisterHttpReplication
impl StructuralPartialEq for CanisterHttpReplication
Auto Trait Implementations§
impl Freeze for CanisterHttpReplication
impl RefUnwindSafe for CanisterHttpReplication
impl Send for CanisterHttpReplication
impl Sync for CanisterHttpReplication
impl Unpin for CanisterHttpReplication
impl UnsafeUnpin for CanisterHttpReplication
impl UnwindSafe for CanisterHttpReplication
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.