pub struct CoreHandle { /* private fields */ }
Expand description
Handle that’s given out to a module to perform actions on the core
Implementations§
Source§impl CoreHandle
impl CoreHandle
Sourcepub fn wrap(core: Arc<SDCore>) -> CoreHandle
pub fn wrap(core: Arc<SDCore>) -> CoreHandle
Wraps core reference with a handle, used for all core features to be able to bypass feature checking
Sourcepub fn check_for_feature(&self, feature: &str) -> bool
pub fn check_for_feature(&self, feature: &str) -> bool
Checks if module is allowed to use this feature
Sourcepub fn required_feature(&self, feature: &str)
pub fn required_feature(&self, feature: &str)
Warns if module is using feature it hasn’t reported
Sourcepub fn clone_for(&self, module: &UniqueSDModule) -> CoreHandle
pub fn clone_for(&self, module: &UniqueSDModule) -> CoreHandle
Clones the handle for specified module
Sourcepub fn module_manager(&self) -> Arc<ModuleManager>
pub fn module_manager(&self) -> Arc<ModuleManager>
Returns module manager reference
Sourcepub fn socket_manager(&self) -> Arc<SocketManager>
pub fn socket_manager(&self) -> Arc<SocketManager>
Returns socket manager reference
Sourcepub async fn current_stack(&self) -> MutexGuard<'_, Vec<ButtonPanel>>
pub async fn current_stack(&self) -> MutexGuard<'_, Vec<ButtonPanel>>
Returns current stack lock
Sourcepub async fn send_core_event_to_modules<T: Iterator<Item = UniqueSDModule> + Send + 'static>(
&self,
event: SDCoreEvent,
modules: T,
)
pub async fn send_core_event_to_modules<T: Iterator<Item = UniqueSDModule> + Send + 'static>( &self, event: SDCoreEvent, modules: T, )
Sends core event to all modules, spawns a separate thread to do it, so doesn’t block current thread
Sourcepub async fn get_stack(&self) -> Vec<ButtonPanel> ⓘ
pub async fn get_stack(&self) -> Vec<ButtonPanel> ⓘ
Gets current panel stack
Sourcepub async fn get_current_screen(&self) -> Option<ButtonPanel>
pub async fn get_current_screen(&self) -> Option<ButtonPanel>
Gets panel that’s currently on top of the stack
Returns a button from current screen on specified position
Sets button to current screen with specified position
Clears button from current screen on specified position
Sourcepub async fn add_component(&self, key: u8, component_name: &str) -> bool
pub async fn add_component(&self, key: u8, component_name: &str) -> bool
Adds component onto a button, returns success boolean
Sourcepub async fn get_component_values(
&self,
key: u8,
component_name: &str,
) -> Option<Vec<UIValue>>
pub async fn get_component_values( &self, key: u8, component_name: &str, ) -> Option<Vec<UIValue>>
Gets component values from a component on a button
Sourcepub async fn get_component_values_with_paths(
&self,
key: u8,
component_name: &str,
) -> Option<Vec<UIPathValue>>
pub async fn get_component_values_with_paths( &self, key: u8, component_name: &str, ) -> Option<Vec<UIPathValue>>
Gets component values from component on a button, but with paths for easier interaction with values
Sourcepub async fn set_component_value(
&self,
key: u8,
component_name: &str,
value: Vec<UIValue>,
) -> bool
pub async fn set_component_value( &self, key: u8, component_name: &str, value: Vec<UIValue>, ) -> bool
Sets component values based on changes for component on a button
Sourcepub async fn add_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str,
) -> bool
pub async fn add_element_component_value( &self, key: u8, component_name: &str, path: &str, ) -> bool
Adds new array element to a component value
Sourcepub async fn remove_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str,
index: usize,
) -> bool
pub async fn remove_element_component_value( &self, key: u8, component_name: &str, path: &str, index: usize, ) -> bool
Removes element from array in component value
Sourcepub async fn set_component_value_by_path(
&self,
key: u8,
component_name: &str,
value: UIPathValue,
) -> bool
pub async fn set_component_value_by_path( &self, key: u8, component_name: &str, value: UIPathValue, ) -> bool
Sets value based on path for component value
Sourcepub async fn remove_component(&self, key: u8, component_name: &str) -> bool
pub async fn remove_component(&self, key: u8, component_name: &str) -> bool
Removes component from a button
Creates a new button taking provided one as an example and makes all responsible modules handle the paste action
Sourcepub async fn push_screen(&self, screen: ButtonPanel)
pub async fn push_screen(&self, screen: ButtonPanel)
Pushes new panel into the stack
Sourcepub async fn pop_screen(&self)
pub async fn pop_screen(&self)
Pops panel from stack
Sourcepub async fn get_root_screen(&self) -> ButtonPanel
pub async fn get_root_screen(&self) -> ButtonPanel
Returns first panel of the stack for saving purposes
Sourcepub async fn save_panels_to_value(&self) -> Value
pub async fn save_panels_to_value(&self) -> Value
Returns first panel of the stack that’s already been serialized
Sourcepub async fn reset_stack(&self, panel: ButtonPanel)
pub async fn reset_stack(&self, panel: ButtonPanel)
Clears the stack and loads provided panel into the stack
Sourcepub async fn load_panels_from_value(
&self,
panels: Value,
) -> Result<(), JSONError>
pub async fn load_panels_from_value( &self, panels: Value, ) -> Result<(), JSONError>
Clears the stack, attempts to deserialize provided panel value into an actual panel and then pushes it into the stack
Triggers button down event on all modules
Triggers button up event on all modules
Triggers button action event for modules that are related to components of the button
Renders what current screen would look like into DynamicImage map
Renders what specified button would look like into DynamicImage
Sourcepub async fn replace_screen(&self, screen: ButtonPanel)
pub async fn replace_screen(&self, screen: ButtonPanel)
Replaces current screen with specified one
Sourcepub async fn set_brightness(&self, brightness: u8)
pub async fn set_brightness(&self, brightness: u8)
Sets brightness of the streamdeck to specified (Range from 0 to 100)
Sourcepub async fn commit_changes(&self)
pub async fn commit_changes(&self)
Commits all changes to layout to device config so it can be later saved
Trait Implementations§
Source§impl Clone for CoreHandle
impl Clone for CoreHandle
Source§fn clone(&self) -> CoreHandle
fn clone(&self) -> CoreHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CoreHandle
impl !RefUnwindSafe for CoreHandle
impl Send for CoreHandle
impl Sync for CoreHandle
impl Unpin for CoreHandle
impl !UnwindSafe for CoreHandle
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>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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>
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
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>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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
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
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>
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>
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>>
OutOfBounds
error is returned which contains
the unclamped color. Read more