Struct ProductOSController

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

Implementations§

Source§

impl ProductOSController

Source

pub fn new( configuration: Configuration, certificates: Certificates, key_value_store: Option<Arc<ProductOSKeyValueStore>>, ) -> Self

Source

pub fn get_registry(&self) -> &Registry

Source

pub async fn discover_nodes(&mut self)

Source

pub fn get_max_servers(&self) -> u8

Source

pub fn upsert_node_local(&mut self, identifier: String, node: Node)

Source

pub fn get_certificates(&self) -> Vec<&[u8]>

Source

pub fn get_private_key(&self) -> &[u8]

Source

pub fn get_certificates_and_private_key(&self) -> Certificates

Source

pub fn validate_certificate(&self, certificate: &[u8]) -> bool

Source

pub fn validate_verify_tag<T>( &self, query: Option<&BTreeMap<String, String>>, payload: Option<T>, headers: Option<&BTreeMap<String, String>>, verify_identifier: &str, verify_tag: &str, ) -> bool
where T: AsByteVector,

Source

pub fn authenticate_command_control<T>( &self, query: Option<&BTreeMap<String, String>>, payload: Option<T>, headers: Option<&BTreeMap<String, String>>, verify_identifier: Option<&str>, verify_tag: Option<&str>, ) -> Result<bool, CommandControlAuthenticateError>
where T: AsByteVector,

Source

pub fn search_and_prepare_command( &self, query: BTreeMap<&str, &str>, module: String, instruction: String, data: Option<Value>, ) -> Result<Command, ProductOSRequestError>

Source

pub fn find_and_prepare_command( &self, key: &str, manager: &str, instruction: String, data: Option<Value>, ) -> Result<Command, ProductOSRequestError>

Source

pub fn find_any_and_prepare_command( &self, capability: &str, manager: &str, instruction: &str, data: Option<Value>, ) -> Result<Command, ProductOSRequestError>

Source

pub async fn find_kind_and_prepare_command( &self, kind: &str, manager: &str, instruction: &str, data: Option<Value>, ) -> Result<Command, ProductOSRequestError>

Source

pub fn search_and_prepare_ask( &self, query: BTreeMap<&str, &str>, path: &str, data: Option<Value>, headers: BTreeMap<String, String>, params: BTreeMap<String, String>, method: Method, ) -> Result<Ask, ProductOSRequestError>

Source

pub async fn find_feature_and_ask( &self, feature: &str, path: &str, data: &Option<Value>, headers: &BTreeMap<String, String>, params: &BTreeMap<String, String>, method: &Method, ) -> Result<ProductOSResponse<BodyBytes>, ProductOSRequestError>

Source

pub fn find_feature_and_prepare_ask( &self, feature: &str, path: &str, data: Option<Value>, headers: BTreeMap<String, String>, params: BTreeMap<String, String>, method: Method, ) -> Result<Ask, ProductOSRequestError>

Source

pub fn get_configuration(&self) -> Configuration

Source

pub fn get_key(&self, identifier: &str) -> Option<Vec<u8>>

Source

pub fn create_key_session(&mut self) -> (String, [u8; 32])

Source

pub fn generate_key( &mut self, session_identifier: &str, remote_public_key: &[u8], association: String, remote_session_identifier: Option<String>, )

Source

pub fn get_key_value_store(&mut self) -> Arc<ProductOSKeyValueStore>

Source

pub async fn add_feature( &mut self, feature: Arc<dyn Feature>, base_path: String, router: &mut ProductOSRouter, )

Source

pub async fn add_feature_mut( &mut self, feature: Arc<Mutex<dyn Feature>>, base_path: String, router: &mut ProductOSRouter, )

Source

pub async fn remove_feature(&mut self, identifier: &str)

Source

pub async fn add_service(&mut self, service: Arc<dyn Service>)

Source

pub async fn add_service_mut(&mut self, service: Arc<Mutex<dyn Service>>)

Source

pub async fn set_service_active(&mut self, identifier: String, status: bool)

Source

pub async fn remove_service(&mut self, identifier: &str)

Source

pub async fn remove_inactive_services(&mut self, query: BTreeMap<&str, &str>)

Source

pub async fn start_services(&mut self) -> Result<(), ()>

Source

pub async fn start_service(&mut self, identifier: &str) -> Result<(), ()>

Source

pub async fn stop_service(&mut self, identifier: &str) -> Result<(), ()>

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> CastSlice<'_, T> for T

Source§

fn cast_slice(selves: &[T]) -> &[T]

Source§

impl<T> CastSliceMut<'_, T> for T

Source§

fn cast_slice_mut(selves: &mut [T]) -> &mut [T]

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,