Struct dazeus::Scope [] [src]

pub struct Scope {
    pub network: Option<String>,
    pub sender: Option<String>,
    pub receiver: Option<String>,
}

A scope for retrieving permissions and properties.

A scope is an optional limitation on which some property or permission applies. A scope consists of three different elements:

  • The network indicates for which network some property or permission should be stored.
  • The sender indicates the IRC user for which some property or permission should be stored.
  • The receiver indicates the channel for which some property or permission should be stored.

Note that for a sender or receiver scope, you also should provide a network, as it makes no sense to for example provide a permission to the same channel on different networks (they are only the same in name, but might be completely different in context).

The most generic scope (and easiest one to start with) is one applied to everything. Such a scope can be created by the Scope::any() method.

Fields

The network on which the scope is limited (if any).

The sender on which the scope is limited (if any).

The receiver on which the scope is limited (if any).

Methods

impl Scope
[src]

Construct a new scope with the specified limitations for network, sender and receiver

Scope to everyone and anything

Scope to a specific network

Scope to a specific sender (typically a channel)

Scope to a specific receiver (typically a user)

Scope to a specific receiver and channel (typically a user in a channel)

Checks whether the scope is set to be applied to everything.

Trait Implementations

impl Debug for Scope
[src]

Formats the value using the given formatter.

impl Clone for Scope
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Scope
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl ToJson for Scope
[src]

Converts the value of self to an instance of JSON