DaemonSession

Struct DaemonSession 

Source
pub struct DaemonSession {
    pub conn: UdpSocket,
    pub packets: Vec<ClientPackets>,
    pub generator: u128,
    pub locations_refs: Vec<LRef>,
    pub element_refs: Vec<ERef>,
    pub module_refs: Vec<MRef>,
    pub watcher_thread: JoinHandle<()>,
}

Fields§

§conn: UdpSocket§packets: Vec<ClientPackets>§generator: u128§locations_refs: Vec<LRef>§element_refs: Vec<ERef>§module_refs: Vec<MRef>§watcher_thread: JoinHandle<()>

Implementations§

Source§

impl DaemonSession

Source

pub fn new() -> Result<Self, Error>

Examples found in repository?
examples/get_location_info.rs (line 5)
3fn main() {
4    {
5        let daemon = DaemonSession::new().unwrap();
6        let session = daemon.create_session();
7
8        let default_location = session.get_default_location().unwrap();
9
10        println!(
11            "Default Location Info: {:?}",
12            default_location.get_location_info().unwrap()
13        );
14
15        let new_element = default_location.create_element("TestElement").unwrap();
16        println!(
17            "Element Info: {:?}",
18            new_element.get_element_info().unwrap()
19        );
20
21        println!(
22            "Default Location Info: {:?}",
23            default_location.get_location_info().unwrap()
24        );
25    }
26}
Source

pub fn pull_packets(&mut self)

Source

pub fn gc_refs(&mut self)

Source

pub fn create_session(self) -> Box<dyn TSession>

Examples found in repository?
examples/get_location_info.rs (line 6)
3fn main() {
4    {
5        let daemon = DaemonSession::new().unwrap();
6        let session = daemon.create_session();
7
8        let default_location = session.get_default_location().unwrap();
9
10        println!(
11            "Default Location Info: {:?}",
12            default_location.get_location_info().unwrap()
13        );
14
15        let new_element = default_location.create_element("TestElement").unwrap();
16        println!(
17            "Element Info: {:?}",
18            new_element.get_element_info().unwrap()
19        );
20
21        println!(
22            "Default Location Info: {:?}",
23            default_location.get_location_info().unwrap()
24        );
25    }
26}

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.