pub struct EventPolicy {
pub send: Vec<String>,
pub receive: Vec<String>,
}Expand description
The pi.events channels an extension may send to, and hear from,
extensions whose grants differ from its own. Each pattern is an exact
channel, a prefix ending in *, or * for every channel.
Fields§
§send: Vec<String>The channels it may send on.
receive: Vec<String>The channels it may hear.
Implementations§
Source§impl EventPolicy
impl EventPolicy
Every channel both ways, as pi shares its bus: the default.
Sourcepub fn isolated() -> EventPolicy
pub fn isolated() -> EventPolicy
No channel either way, so only extensions with identical grants hear it and are heard.
Sourcepub fn new(
send: Vec<String>,
receive: Vec<String>,
) -> Result<EventPolicy, String>
pub fn new( send: Vec<String>, receive: Vec<String>, ) -> Result<EventPolicy, String>
The policy with patterns send and receive. Err names the first
pattern that is empty or uses glob syntax other than a final *.
Sourcepub fn intersection(&self, other: &EventPolicy) -> EventPolicy
pub fn intersection(&self, other: &EventPolicy) -> EventPolicy
The channels both self and other send on and hear.
Trait Implementations§
Source§impl Clone for EventPolicy
impl Clone for EventPolicy
Source§impl Debug for EventPolicy
impl Debug for EventPolicy
Source§impl Default for EventPolicy
impl Default for EventPolicy
Source§fn default() -> EventPolicy
fn default() -> EventPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventPolicy
Read from "shared", "isolated", or { send, receive }, where a
missing list is empty.
impl<'de> Deserialize<'de> for EventPolicy
Read from "shared", "isolated", or { send, receive }, where a
missing list is empty.
Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<EventPolicy, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<EventPolicy, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EventPolicy
Source§impl Hash for EventPolicy
impl Hash for EventPolicy
Source§impl PartialEq for EventPolicy
impl PartialEq for EventPolicy
Source§impl Serialize for EventPolicy
Written as a manifest writes it: "shared", "isolated", or
{ send, receive }.
impl Serialize for EventPolicy
Written as a manifest writes it: "shared", "isolated", or
{ send, receive }.
impl StructuralPartialEq for EventPolicy
Auto Trait Implementations§
impl Forget for EventPolicy
impl Freeze for EventPolicy
impl RefUnwindSafe for EventPolicy
impl Send for EventPolicy
impl Sync for EventPolicy
impl Unpin for EventPolicy
impl UnsafeUnpin for EventPolicy
impl UnwindSafe for EventPolicy
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
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>,
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
Compare self to
key and return true if they are equal.