Struct Repository

Source
pub struct Repository { /* private fields */ }

Implementations§

Source§

impl Repository

Source

pub fn new(admin_attribute: &str) -> Repository

Examples found in repository?
examples/multiple_server/main.rs (line 12)
7fn main() {
8    let ip_address = String::from("127.0.0.1");
9    let port_tcp = String::from("9000");
10    let port_udp = String::from("9001");
11
12    let repository = Repository::new("admin");
13    let key = "an_example_very_";
14
15    repository.add_tuple_space(String::from("DATA"),vec![String::from("admin")]);
16
17    repository.add_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::str("test")]));
18    repository.remove_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::Any]));
19
20    let server_tcp = Server::new(Protocol::TCP, &ip_address, &port_tcp, &repository,key);
21    let server_udp = Server::new(Protocol::UDP, &ip_address, &port_udp, &repository,key);
22
23    let server_launcher = ServerLauncher::new(vec![server_tcp, server_udp]);
24    server_launcher.launch_server();
25}
Source

pub fn add_tuple_space(&self, name: String, attributes: Vec<String>)

Examples found in repository?
examples/multiple_server/main.rs (line 15)
7fn main() {
8    let ip_address = String::from("127.0.0.1");
9    let port_tcp = String::from("9000");
10    let port_udp = String::from("9001");
11
12    let repository = Repository::new("admin");
13    let key = "an_example_very_";
14
15    repository.add_tuple_space(String::from("DATA"),vec![String::from("admin")]);
16
17    repository.add_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::str("test")]));
18    repository.remove_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::Any]));
19
20    let server_tcp = Server::new(Protocol::TCP, &ip_address, &port_tcp, &repository,key);
21    let server_udp = Server::new(Protocol::UDP, &ip_address, &port_udp, &repository,key);
22
23    let server_launcher = ServerLauncher::new(vec![server_tcp, server_udp]);
24    server_launcher.launch_server();
25}
Source

pub fn remove_tuple_space(&self, name: &str)

Source

pub fn add_tuple_to_tuple_space(&self, tuple_space: String, tuple: Tuple)

Examples found in repository?
examples/multiple_server/main.rs (line 17)
7fn main() {
8    let ip_address = String::from("127.0.0.1");
9    let port_tcp = String::from("9000");
10    let port_udp = String::from("9001");
11
12    let repository = Repository::new("admin");
13    let key = "an_example_very_";
14
15    repository.add_tuple_space(String::from("DATA"),vec![String::from("admin")]);
16
17    repository.add_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::str("test")]));
18    repository.remove_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::Any]));
19
20    let server_tcp = Server::new(Protocol::TCP, &ip_address, &port_tcp, &repository,key);
21    let server_udp = Server::new(Protocol::UDP, &ip_address, &port_udp, &repository,key);
22
23    let server_launcher = ServerLauncher::new(vec![server_tcp, server_udp]);
24    server_launcher.launch_server();
25}
Source

pub fn remove_tuple_to_tuple_space(&self, tuple_space: String, tuple: Tuple)

Examples found in repository?
examples/multiple_server/main.rs (line 18)
7fn main() {
8    let ip_address = String::from("127.0.0.1");
9    let port_tcp = String::from("9000");
10    let port_udp = String::from("9001");
11
12    let repository = Repository::new("admin");
13    let key = "an_example_very_";
14
15    repository.add_tuple_space(String::from("DATA"),vec![String::from("admin")]);
16
17    repository.add_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::str("test")]));
18    repository.remove_tuple_to_tuple_space(String::from("DATA"), Tuple::new(&[E::Any]));
19
20    let server_tcp = Server::new(Protocol::TCP, &ip_address, &port_tcp, &repository,key);
21    let server_udp = Server::new(Protocol::UDP, &ip_address, &port_udp, &repository,key);
22
23    let server_launcher = ServerLauncher::new(vec![server_tcp, server_udp]);
24    server_launcher.launch_server();
25}
Source

pub fn check_permission( &self, action: &str, attributes: &Vec<String>, tuple_space_name: Option<&str>, ) -> bool

Source

pub fn add_permission_list( &self, attributes: Vec<String>, tuple_space_name: &str, )

Source

pub fn add_permission( &self, attribute: &String, action: &str, tuple_space_name: &str, )

Source

pub fn manage_request( &self, request: &[u8], client_option: Option<&TupleSpace>, key: &str, ) -> RequestResponse

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.