[−][src]Struct artifice_manager::Manager
this is the main management structure that other structures work through
Example
use networking::{ArtificeHost}; let database = ArtificeDB::default(); let manager = Manager::load(database, b"example_password").unwrap(); let host = ArtificeHost::from_host_data(manager.config()); for networkstream in host { // do something with the peer }
Implementations
impl Manager
[src]
pub fn load(database: ArtificeDB, password: &[u8]) -> Result<Self, Error>
[src]
loads the configuration for artifice from its respective files in the database
Arguments
database: the database to load, password: decryption key used to read and write files
Example
use manager::{ArtificeDB, Manager}; use manager::database::Database; use networking::peers::ArtificePeer; use networking::ArtificeHost; fn main(){ let database = ArtificeDB::default(); let manager = Manager::load(database, b"example password").unwrap(); let host = ArtificeHost::from_host_data(manager.config()).unwrap(); for netstream in host { let stream = netstream.unwrap(); if manager.authenticate(stream.peer()).unwrap() { println!("peer authenticated"); } } }
pub fn config(&self) -> ArtificeConfig
[src]
pub fn authenticate(&self, peer: &ArtificePeer) -> Result<bool>
[src]
pub fn get_peer(&self, key: &str) -> Result<ArtificePeer>
[src]
pub fn permissions(&self) -> PermissionManager
[src]
pub fn peers(&self) -> ArtificePeers
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl UnwindSafe for Manager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,