pub struct SDCore {Show 13 fields
pub serial_number: String,
pub module_manager: Arc<ModuleManager>,
pub render_manager: Arc<RenderingManager>,
pub socket_manager: Arc<SocketManager>,
pub config: Arc<Config>,
pub device_config: UniqueDeviceConfig,
pub current_stack: Mutex<Vec<ButtonPanel>>,
pub image_size: (usize, usize),
pub image_collection: ImageCollection,
pub kind: Kind,
pub key_count: u8,
pub frame_rate: u32,
pub should_close: RwLock<bool>,
/* private fields */
}
Expand description
Core struct that contains all relevant information about streamdeck and manages the streamdeck
Fields§
§serial_number: String
Serial number of the device
module_manager: Arc<ModuleManager>
Module manager
render_manager: Arc<RenderingManager>
Rendering manager
socket_manager: Arc<SocketManager>
Socket manager
config: Arc<Config>
Config
device_config: UniqueDeviceConfig
Device config associated with the device
current_stack: Mutex<Vec<ButtonPanel>>
Current panel stack
image_size: (usize, usize)
Image size supported by streamdeck
image_collection: ImageCollection
Image collection to use for thread
kind: Kind
Kind of streamdeck device
key_count: u8
Key count of the streamdeck device
frame_rate: u32
Pool rate of how often should the core read events from the device
should_close: RwLock<bool>
Decides if core is dead
Implementations§
Source§impl SDCore
impl SDCore
Sourcepub async fn blank(
module_manager: Arc<ModuleManager>,
render_manager: Arc<RenderingManager>,
socket_manager: Arc<SocketManager>,
config: Arc<Config>,
device_config: UniqueDeviceConfig,
image_collection: ImageCollection,
) -> Arc<SDCore>
pub async fn blank( module_manager: Arc<ModuleManager>, render_manager: Arc<RenderingManager>, socket_manager: Arc<SocketManager>, config: Arc<Config>, device_config: UniqueDeviceConfig, image_collection: ImageCollection, ) -> Arc<SDCore>
Creates an instance of core that is already dead
Sourcepub async fn new(
module_manager: Arc<ModuleManager>,
render_manager: Arc<RenderingManager>,
socket_manager: Arc<SocketManager>,
config: Arc<Config>,
device_config: UniqueDeviceConfig,
image_collection: ImageCollection,
connection: StreamDeck,
frame_rate: u32,
) -> Arc<SDCore>
pub async fn new( module_manager: Arc<ModuleManager>, render_manager: Arc<RenderingManager>, socket_manager: Arc<SocketManager>, config: Arc<Config>, device_config: UniqueDeviceConfig, image_collection: ImageCollection, connection: StreamDeck, frame_rate: u32, ) -> Arc<SDCore>
Creates an instance of the core over existing streamdeck connection
Sourcepub async fn mark_for_redraw(&self)
pub async fn mark_for_redraw(&self)
Tells device thread to refresh screen
Sourcepub async fn send_commands(&self, commands: Vec<DeviceThreadCommunication>)
pub async fn send_commands(&self, commands: Vec<DeviceThreadCommunication>)
Sends commands to streamdeck thread
Sourcepub async fn serial_number(&self) -> String
pub async fn serial_number(&self) -> String
Gets serial number of the core
Auto Trait Implementations§
impl !Freeze for SDCore
impl !RefUnwindSafe for SDCore
impl Send for SDCore
impl Sync for SDCore
impl Unpin for SDCore
impl !UnwindSafe for SDCore
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