pub struct CoreManager {
pub config: Arc<Config>,
pub module_manager: Arc<ModuleManager>,
pub render_manager: Arc<RenderingManager>,
pub socket_manager: Arc<SocketManager>,
/* private fields */
}
Expand description
Core manager struct
Fields§
§config: Arc<Config>
Config
module_manager: Arc<ModuleManager>
Module manager
render_manager: Arc<RenderingManager>
Render manager
socket_manager: Arc<SocketManager>
Socket manager
Implementations§
Source§impl CoreManager
impl CoreManager
Sourcepub fn new(
module_manager: Arc<ModuleManager>,
render_manager: Arc<RenderingManager>,
socket_manager: Arc<SocketManager>,
config: Arc<Config>,
) -> Arc<CoreManager>
pub fn new( module_manager: Arc<ModuleManager>, render_manager: Arc<RenderingManager>, socket_manager: Arc<SocketManager>, config: Arc<Config>, ) -> Arc<CoreManager>
Creates new core manager with provided module manager and config
Sourcepub async fn add_devices_from_config(&self)
pub async fn add_devices_from_config(&self)
Adds all devices from config to managed devices, used at start of the software
Sourcepub async fn list_available_devices(&self) -> Vec<(u16, u16, String)>
pub async fn list_available_devices(&self) -> Vec<(u16, u16, String)>
Lists detected unmanaged devices
Sourcepub async fn add_device(&self, vid: u16, pid: u16, serial: &str)
pub async fn add_device(&self, vid: u16, pid: u16, serial: &str)
Adds device to automatic reconnection
Sourcepub async fn connect_device(
&self,
vid: u16,
pid: u16,
serial: &str,
) -> Result<DeviceData, String>
pub async fn connect_device( &self, vid: u16, pid: u16, serial: &str, ) -> Result<DeviceData, String>
Connects to a device
Sourcepub async fn remove_device(&self, serial: &str)
pub async fn remove_device(&self, serial: &str)
Removes device from automatic reconnection and stops current connection to it
Sourcepub async fn list_added_devices(&self) -> HashMap<String, DeviceData>
pub async fn list_added_devices(&self) -> HashMap<String, DeviceData>
Lists managed devices
Sourcepub async fn is_device_added(&self, serial: &str) -> bool
pub async fn is_device_added(&self, serial: &str) -> bool
Returns if specific device is in managed list
Sourcepub async fn get_device(&self, serial: &str) -> Option<DeviceData>
pub async fn get_device(&self, serial: &str) -> Option<DeviceData>
Gets device data from managed devices
Sourcepub async fn reconnect_routine(&self)
pub async fn reconnect_routine(&self)
Starts running reconnection routine on current thread, probably spawn it out as a separate thread
Auto Trait Implementations§
impl !Freeze for CoreManager
impl !RefUnwindSafe for CoreManager
impl Send for CoreManager
impl Sync for CoreManager
impl Unpin for CoreManager
impl !UnwindSafe for CoreManager
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more