pub struct Policy {Show 15 fields
pub give_vocabularies: bool,
pub answer_queries: bool,
pub translate: bool,
pub vocabularies: Option<BTreeSet<String>>,
pub max_message_tokens: u64,
pub accept_vocabularies: bool,
pub accept_proposals: bool,
pub max_frame_bytes: u64,
pub max_vocabulary_tokens: u64,
pub max_decoded_units: u64,
pub max_held_vocabularies: u64,
pub max_held_tokens: u64,
pub max_inbox_messages: u64,
pub max_inbox_bytes: u64,
pub replay_window: u64,
}Expand description
What a peer is willing to do for the other side.
The default takes nothing new from the other side (no vocabularies, no proposals) and gives nothing away (no vocabulary files, no answers about symbols, no translation). It delivers messages encoded under a vocabulary this peer holds, and that is all. Everything else has to be switched on.
Fields§
§give_vocabularies: boolSend a held vocabulary’s file to the other side when it asks.
answer_queries: boolSay whether a held vocabulary has a token for given symbols.
translate: boolRe-encode the other side’s sequences under another held vocabulary.
vocabularies: Option<BTreeSet<String>>The held vocabularies the other side may use at all, by digest;
None is every one held. One that is held but not listed is
answered as if it were not held. A vocabulary the other side adds
itself (when it may) joins the list.
max_message_tokens: u64Refuse a container that declares more tokens than this, before its ids are decompressed. Four bytes of memory per token.
accept_vocabularies: boolTake vocabularies it does not have from the other side.
accept_proposals: boolExtend a held vocabulary when the other side proposes it.
max_frame_bytes: u64§max_vocabulary_tokens: u64§max_decoded_units: u64Refuse a message that would decode to more than this.
max_held_vocabularies: u64The most vocabularies this peer will hold, counting its own. The other side cannot add one past this.
max_held_tokens: u64The most tokens over all held vocabularies, counting its own.
max_inbox_messages: u64Delivered messages kept until take_inbox. When full, a message is
answered BUSY and not delivered.
max_inbox_bytes: u64Bytes kept until take_inbox: for each message its decoded bytes,
its token ids at four bytes each, and its container.
replay_window: u64How many of the latest message ids are remembered, so that a repeat gets its first receipt again instead of a second delivery.
Trait Implementations§
impl Eq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Forget for Policy
impl Freeze for Policy
impl Move for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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<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