Struct streamduck_core::core::CoreHandle
source · [−]pub struct CoreHandle { /* private fields */ }
Expand description
Handle that’s given out to a module to perform actions on the core
Implementations
sourceimpl 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 fn current_stack(&self) -> LockResult<MutexGuard<'_, Vec<ButtonPanel>>>
pub fn current_stack(&self) -> LockResult<MutexGuard<'_, Vec<ButtonPanel>>>
Returns current stack lock
sourcepub fn send_core_event_to_modules<T: Iterator<Item = UniqueSDModule> + Send + 'static>(
&self,
event: SDCoreEvent,
modules: T
)
pub 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 fn get_stack(&self) -> Vec<ButtonPanel>
pub fn get_stack(&self) -> Vec<ButtonPanel>
Gets current panel stack
sourcepub fn get_current_screen(&self) -> Option<ButtonPanel>
pub 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 fn add_component(&self, key: u8, component_name: &str) -> bool
pub fn add_component(&self, key: u8, component_name: &str) -> bool
Adds component onto a button, returns success boolean
sourcepub fn get_component_values(
&self,
key: u8,
component_name: &str
) -> Option<Vec<UIValue>>
pub fn get_component_values(
&self,
key: u8,
component_name: &str
) -> Option<Vec<UIValue>>
Gets component values from a component on a button
sourcepub fn get_component_values_with_paths(
&self,
key: u8,
component_name: &str
) -> Option<Vec<UIPathValue>>
pub 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 fn set_component_value(
&self,
key: u8,
component_name: &str,
value: Vec<UIValue>
) -> bool
pub 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 fn add_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str
) -> bool
pub fn add_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str
) -> bool
Adds new array element to a component value
sourcepub fn remove_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str,
index: usize
) -> bool
pub fn remove_element_component_value(
&self,
key: u8,
component_name: &str,
path: &str,
index: usize
) -> bool
Removes element from array in component value
sourcepub fn set_component_value_by_path(
&self,
key: u8,
component_name: &str,
value: UIPathValue
) -> bool
pub fn set_component_value_by_path(
&self,
key: u8,
component_name: &str,
value: UIPathValue
) -> bool
Sets value based on path for component value
sourcepub fn remove_component(&self, key: u8, component_name: &str) -> bool
pub 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 fn push_screen(&self, screen: ButtonPanel)
pub fn push_screen(&self, screen: ButtonPanel)
Pushes new panel into the stack
sourcepub fn pop_screen(&self)
pub fn pop_screen(&self)
Pops panel from stack
sourcepub fn get_root_screen(&self) -> ButtonPanel
pub fn get_root_screen(&self) -> ButtonPanel
Returns first panel of the stack for saving purposes
sourcepub fn save_panels_to_value(&self) -> Value
pub fn save_panels_to_value(&self) -> Value
Returns first panel of the stack that’s already been serialized
sourcepub fn reset_stack(&self, panel: ButtonPanel)
pub fn reset_stack(&self, panel: ButtonPanel)
Clears the stack and loads provided panel into the stack
sourcepub fn load_panels_from_value(&self, panels: Value) -> Result<(), JSONError>
pub 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 fn replace_screen(&self, screen: ButtonPanel)
pub fn replace_screen(&self, screen: ButtonPanel)
Replaces current screen with specified one
sourcepub fn set_brightness(&self, brightness: u8)
pub fn set_brightness(&self, brightness: u8)
Sets brightness of the streamdeck to specified (Range from 0 to 100)
sourcepub fn commit_changes(&self)
pub fn commit_changes(&self)
Commits all changes to layout to device config so it can be later saved
Trait Implementations
sourceimpl Clone for CoreHandle
impl Clone for CoreHandle
sourcefn clone(&self) -> CoreHandle
fn clone(&self) -> CoreHandle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for CoreHandle
impl Send for CoreHandle
impl Sync for CoreHandle
impl Unpin for CoreHandle
impl UnwindSafe for CoreHandle
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
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.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn 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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn 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
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.