pub struct PluginHandle { /* private fields */ }Expand description
插件服务句柄,绑定插件身份与配置。
跨平台 struct,通过 Arc
Implementations§
Source§impl PluginHandle
impl PluginHandle
Sourcepub fn new(
plugin_id: String,
config: PluginSdkConfig,
capabilities: PlatformCapabilities,
theme_provider: Arc<dyn ThemeProvider>,
theme_mode: Arc<RwLock<String>>,
icon_extractor: Arc<dyn IconExtractor>,
icon_cache: Arc<IconCacheService>,
shell_executor: Arc<dyn ShellExecutor>,
window_manager: Arc<dyn WindowManager>,
path_resolver: Arc<dyn PathResolver>,
app_enumerator: Arc<dyn AppEnumerator>,
app_launcher: Arc<dyn AppLauncher>,
lnk_resolver: Arc<dyn LnkResolver>,
resource_loader: Arc<dyn ResourceLoader>,
parameter_resolver: Arc<dyn ParameterResolver>,
timer_manager: Arc<dyn TimerManager>,
app_resource: Arc<AppResourceService>,
storage: Arc<RwLock<Arc<dyn StorageService>>>,
hotkey_manager: Arc<dyn HotkeyManager>,
installation_monitor: Arc<dyn InstallationMonitor>,
focus_monitor: Arc<dyn FocusMonitor>,
clipboard_manager: Arc<dyn ClipboardManager>,
model_service: Arc<dyn ModelService>,
) -> Self
pub fn new( plugin_id: String, config: PluginSdkConfig, capabilities: PlatformCapabilities, theme_provider: Arc<dyn ThemeProvider>, theme_mode: Arc<RwLock<String>>, icon_extractor: Arc<dyn IconExtractor>, icon_cache: Arc<IconCacheService>, shell_executor: Arc<dyn ShellExecutor>, window_manager: Arc<dyn WindowManager>, path_resolver: Arc<dyn PathResolver>, app_enumerator: Arc<dyn AppEnumerator>, app_launcher: Arc<dyn AppLauncher>, lnk_resolver: Arc<dyn LnkResolver>, resource_loader: Arc<dyn ResourceLoader>, parameter_resolver: Arc<dyn ParameterResolver>, timer_manager: Arc<dyn TimerManager>, app_resource: Arc<AppResourceService>, storage: Arc<RwLock<Arc<dyn StorageService>>>, hotkey_manager: Arc<dyn HotkeyManager>, installation_monitor: Arc<dyn InstallationMonitor>, focus_monitor: Arc<dyn FocusMonitor>, clipboard_manager: Arc<dyn ClipboardManager>, model_service: Arc<dyn ModelService>, ) -> Self
Creates a new PluginHandle with all the service references injected.
Sourcepub async fn get_icon(
&self,
request: IconRequest,
) -> Result<Vec<u8>, HostApiError>
pub async fn get_icon( &self, request: IconRequest, ) -> Result<Vec<u8>, HostApiError>
根据图标请求提取图标数据,行为由注册时的缓存等级决定。 参数:request - 图标请求(路径/网址/扩展名)。 返回:WebP 格式的图标字节数据(回退路径可能为 PNG),失败返回 HostApiError。
Sourcepub async fn get_icon_or_default(&self, request: IconRequest) -> Vec<u8> ⓘ
pub async fn get_icon_or_default(&self, request: IconRequest) -> Vec<u8> ⓘ
提取图标数据,失败时回退到默认图标。 与 get_icon 不同,此方法永不返回错误,提取失败时返回默认图标数据。
Sourcepub async fn get_icon_and_update_cache(
&self,
request: IconRequest,
) -> Result<Vec<u8>, HostApiError>
pub async fn get_icon_and_update_cache( &self, request: IconRequest, ) -> Result<Vec<u8>, HostApiError>
强制从磁盘提取图标数据并根据缓存等级更新缓存。 与 get_icon 不同,此方法跳过缓存读取,直接提取并更新缓存。 参数:request - 图标请求(路径/网址/扩展名)。 返回:WebP 格式的图标字节数据(回退路径可能为 PNG),失败返回 HostApiError。
Sourcepub async fn override_icon_cache(
&self,
original_request: &IconRequest,
custom_icon_path: &str,
) -> Result<(), HostApiError>
pub async fn override_icon_cache( &self, original_request: &IconRequest, custom_icon_path: &str, ) -> Result<(), HostApiError>
覆盖指定 IconRequest 的缓存图标为自定义图标文件。 参数:original_request - 需要覆盖图标的原始 IconRequest custom_icon_path - 用户选择的自定义图标文件路径 返回:成功返回 Ok(()), 失败返回 HostApiError
Sourcepub async fn shell_open(&self, target: OpenTarget) -> Result<(), HostApiError>
pub async fn shell_open(&self, target: OpenTarget) -> Result<(), HostApiError>
使用系统默认方式打开目标(文件/网址/文件夹)。 参数:target - 打开目标。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn shell_open_folder(&self, path: &str) -> Result<(), HostApiError>
pub async fn shell_open_folder(&self, path: &str) -> Result<(), HostApiError>
在文件资源管理器中打开指定路径的父目录并选中该文件。 参数:path - 要打开所在位置的文件路径。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn shell_execute_elevation(
&self,
path: &str,
) -> Result<(), HostApiError>
pub async fn shell_execute_elevation( &self, path: &str, ) -> Result<(), HostApiError>
以管理员权限启动程序。 参数:path - 要以管理员身份运行的程序路径。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn shell_execute_command(
&self,
command: &str,
) -> Result<(), HostApiError>
pub async fn shell_execute_command( &self, command: &str, ) -> Result<(), HostApiError>
执行命令字符串(后台运行,无窗口)。 参数:command - 要执行的命令字符串。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn activate_window_by_process(
&self,
process_name: &str,
) -> Result<bool, HostApiError>
pub async fn activate_window_by_process( &self, process_name: &str, ) -> Result<bool, HostApiError>
根据进程名(如 “chrome.exe”)激活已存在的窗口。 参数:process_name - 进程名(含扩展名)。 返回:成功激活返回 Ok(true),未找到窗口返回 Ok(false),失败返回 HostApiError。
Sourcepub async fn activate_window_by_title(
&self,
title: &str,
) -> Result<bool, HostApiError>
pub async fn activate_window_by_title( &self, title: &str, ) -> Result<bool, HostApiError>
根据窗口标题的部分内容激活已存在的窗口。 参数:title - 窗口标题的部分匹配文本。 返回:成功激活返回 Ok(true),未找到窗口返回 Ok(false),失败返回 HostApiError。
Sourcepub async fn activate_window_by_pid(
&self,
pid: u32,
) -> Result<bool, HostApiError>
pub async fn activate_window_by_pid( &self, pid: u32, ) -> Result<bool, HostApiError>
根据进程 PID 激活已存在的窗口。 参数:pid - 进程标识符。 返回:成功激活返回 Ok(true),未找到窗口返回 Ok(false),失败返回 HostApiError。
Sourcepub fn resolve_path(&self, path: KnownPath) -> Result<String, HostApiError>
pub fn resolve_path(&self, path: KnownPath) -> Result<String, HostApiError>
根据已知路径类型解析实际文件系统路径。 参数:path - 已知路径类型枚举。 返回:解析后的路径字符串,失败返回 HostApiError。
Sourcepub fn set_clipboard_text(&self, text: &str) -> Result<(), HostApiError>
pub fn set_clipboard_text(&self, text: &str) -> Result<(), HostApiError>
将文本写入系统剪贴板。 参数:text - 要写入的文本内容。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn enumerate_apps(&self) -> Vec<AppInfo>
pub async fn enumerate_apps(&self) -> Vec<AppInfo>
枚举当前平台已安装的应用。 参数:无。 返回:应用信息列表。
Sourcepub async fn launch_app(
&self,
app_id: &str,
args: Option<&[String]>,
) -> Result<u32, HostApiError>
pub async fn launch_app( &self, app_id: &str, args: Option<&[String]>, ) -> Result<u32, HostApiError>
启动指定应用。 参数:app_id - 应用唯一标识;args - 启动参数(可选)。 返回:成功返回 Ok(pid),失败返回 HostApiError。
Sourcepub fn get_app_icon_path(&self, name: &str) -> Option<String>
pub fn get_app_icon_path(&self, name: &str) -> Option<String>
根据名称获取内置图标资源的文件系统路径。 参数:name - 图标名称(如 “tray_icon”, “web_pages” 等)。 返回:图标路径,未注册则返回 None。
Sourcepub fn resolve_lnk_target(&self, lnk_path: &str) -> Option<String>
pub fn resolve_lnk_target(&self, lnk_path: &str) -> Option<String>
解析 .lnk 快捷方式文件的目标路径。 参数:lnk_path - .lnk 文件的路径。 返回:解析成功返回目标路径,失败返回 None。
Sourcepub fn parse_localized_names_from_dir(
&self,
dir_path: &Path,
) -> HashMap<String, String>
pub fn parse_localized_names_from_dir( &self, dir_path: &Path, ) -> HashMap<String, String>
解析指定目录下的 desktop.ini 文件,提取 [LocalizedFileNames] 部分。 参数:dir_path - 要解析的目录路径。 返回:从原始文件名到本地化名称的映射。
Sourcepub fn update_config(&self, config: PluginSdkConfig)
pub fn update_config(&self, config: PluginSdkConfig)
更新插件的 SDK 配置。 参数:config - 新的插件 SDK 配置。 返回:无。 特性:立即生效,影响后续所有服务调用。
Sourcepub fn capabilities(&self) -> &PlatformCapabilities
pub fn capabilities(&self) -> &PlatformCapabilities
查询当前平台支持的能力集合。 参数:无。 返回:平台能力的不可变引用。
Sourcepub fn get_theme(&self) -> Result<Theme, HostApiError>
pub fn get_theme(&self) -> Result<Theme, HostApiError>
查询宿主当前实际生效的界面主题。 显式 light/dark 配置直接返回;system 模式委托平台读取系统主题。
Sourcepub fn get_system_theme(&self) -> Result<Theme, HostApiError>
pub fn get_system_theme(&self) -> Result<Theme, HostApiError>
查询系统主题(未应用宿主显式 light/dark 配置),供前端 system 模式跟随。
Sourcepub fn model_list(&self) -> Vec<ModelInfo>
pub fn model_list(&self) -> Vec<ModelInfo>
全网模型清单(聚合缓存,含所有已注册提供方)。
Sourcepub async fn model_chat(
&self,
req: ModelChatRequest,
) -> Result<ModelChatResponse, ModelError>
pub async fn model_chat( &self, req: ModelChatRequest, ) -> Result<ModelChatResponse, ModelError>
按 model_id 调用文本生成。
Sourcepub async fn model_embedding(
&self,
req: ModelEmbeddingRequest,
) -> Result<ModelEmbeddingResponse, ModelError>
pub async fn model_embedding( &self, req: ModelEmbeddingRequest, ) -> Result<ModelEmbeddingResponse, ModelError>
按 model_id 调用文本向量化(task_type 必填,宿主对缺失/未知值返回 InvalidRequest)。
Sourcepub async fn model_similarity(
&self,
req: ModelSimilarityRequest,
) -> Result<ModelSimilarityResponse, ModelError>
pub async fn model_similarity( &self, req: ModelSimilarityRequest, ) -> Result<ModelSimilarityResponse, ModelError>
按 model_id 计算查询向量与多个目标向量的相似度。
Sourcepub async fn resolve_parameters(
&self,
template: &str,
user_args: &[String],
snapshot: &ParameterSnapshot,
) -> Result<String, HostApiError>
pub async fn resolve_parameters( &self, template: &str, user_args: &[String], snapshot: &ParameterSnapshot, ) -> Result<String, HostApiError>
解析参数模板
参数:
- template: 包含占位符的模板字符串
- user_args: 用户输入的参数列表
- snapshot: 系统参数快照(不透明句柄)
返回:填充后的完整字符串
Sourcepub fn count_user_parameters(&self, template: &str) -> usize
pub fn count_user_parameters(&self, template: &str) -> usize
统计模板中需要用户输入的参数数量
参数:template - 模板字符串 返回:位置参数的数量
Sourcepub fn has_system_parameters(&self, template: &str) -> bool
pub fn has_system_parameters(&self, template: &str) -> bool
检查模板是否包含系统参数
参数:template - 模板字符串 返回:是否包含系统参数
Sourcepub async fn set_timeout(
&self,
delay: Duration,
callback: TimerCallback,
) -> Result<TimerId, HostApiError>
pub async fn set_timeout( &self, delay: Duration, callback: TimerCallback, ) -> Result<TimerId, HostApiError>
创建一个一次性定时器,在指定延迟后触发回调。
参数:
- delay: 触发延迟时长
- callback: 触发时调用的回调函数
返回:TimerId,可用于取消定时器。
Sourcepub async fn set_interval(
&self,
interval: Duration,
callback: TimerCallback,
) -> Result<TimerId, HostApiError>
pub async fn set_interval( &self, interval: Duration, callback: TimerCallback, ) -> Result<TimerId, HostApiError>
创建一个重复定时器,每隔指定间隔触发回调。
参数:
- interval: 触发间隔时长
- callback: 每次触发时调用的回调函数
返回:TimerId,可用于取消定时器。
Sourcepub async fn cancel_timer(&self, id: TimerId) -> Result<(), HostApiError>
pub async fn cancel_timer(&self, id: TimerId) -> Result<(), HostApiError>
取消指定 ID 的定时器。
参数:id - 要取消的定时器 ID。
Sourcepub async fn cancel_all_timers(&self) -> Result<(), HostApiError>
pub async fn cancel_all_timers(&self) -> Result<(), HostApiError>
取消所有定时器。
Sourcepub async fn resource_upload(
&self,
resource_id: &str,
file_path: &str,
max_size: Option<u64>,
) -> Result<String, HostApiError>
pub async fn resource_upload( &self, resource_id: &str, file_path: &str, max_size: Option<u64>, ) -> Result<String, HostApiError>
上传资源文件到本插件的资源空间。
Sourcepub async fn resource_put(
&self,
resource_id: &str,
data: &[u8],
) -> Result<(), HostApiError>
pub async fn resource_put( &self, resource_id: &str, data: &[u8], ) -> Result<(), HostApiError>
直接写入资源字节数据,无需先创建临时文件或提供本地路径。 参数:resource_id - 资源标识符;data - 资源字节内容。 返回:成功返回 Ok(()),失败返回 HostApiError。
Sourcepub async fn resource_get(
&self,
resource_id: &str,
) -> Result<Vec<u8>, HostApiError>
pub async fn resource_get( &self, resource_id: &str, ) -> Result<Vec<u8>, HostApiError>
获取资源文件内容。
Sourcepub async fn resource_delete(
&self,
resource_id: &str,
) -> Result<(), HostApiError>
pub async fn resource_delete( &self, resource_id: &str, ) -> Result<(), HostApiError>
删除资源文件。
Sourcepub async fn resource_list(&self) -> Result<Vec<String>, HostApiError>
pub async fn resource_list(&self) -> Result<Vec<String>, HostApiError>
列出本插件的所有资源。
Sourcepub async fn cache_put(
&self,
domain: &str,
key: &str,
data: &[u8],
) -> Result<(), HostApiError>
pub async fn cache_put( &self, domain: &str, key: &str, data: &[u8], ) -> Result<(), HostApiError>
写入插件本地缓存。
参数:domain - 缓存域(按用途隔离,如 “model-embedding”);key - 缓存键;data - 缓存字节内容。
返回:成功返回 Ok(())。
与 resource_* 的区别:缓存存放可再生的本地数据(如模型向量),
不经过 StorageService,WebDAV 同步模式不会上传远端;
路径为 <app_data>/plugin-cache/<plugin_id>/
Sourcepub async fn cache_get(
&self,
domain: &str,
key: &str,
) -> Result<Option<Vec<u8>>, HostApiError>
pub async fn cache_get( &self, domain: &str, key: &str, ) -> Result<Option<Vec<u8>>, HostApiError>
读取插件本地缓存;缓存不存在时返回 Ok(None)。
Sourcepub async fn cache_delete(
&self,
domain: &str,
key: &str,
) -> Result<(), HostApiError>
pub async fn cache_delete( &self, domain: &str, key: &str, ) -> Result<(), HostApiError>
删除插件本地缓存条目;缓存不存在时视为成功。
Sourcepub async fn cache_cleanup(
&self,
domain: &str,
max_entries: usize,
) -> Result<(), HostApiError>
pub async fn cache_cleanup( &self, domain: &str, max_entries: usize, ) -> Result<(), HostApiError>
容量控制:缓存域条目超过 max_entries 时按修改时间删除最旧条目。
目录结构 <cache_root>/<plugin_id>/
Sourcepub fn register_hotkey_callback(
&self,
id: &str,
filter: HotkeyEventFilter,
callback: HotkeyCallback,
)
pub fn register_hotkey_callback( &self, id: &str, filter: HotkeyEventFilter, callback: HotkeyCallback, )
注册按键事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”);filter - 事件过滤器;callback - 回调函数。
Sourcepub fn unregister_hotkey_callback(&self, id: &str)
pub fn unregister_hotkey_callback(&self, id: &str)
注销按键事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”)。
Sourcepub fn register_installation_callback(
&self,
id: &str,
callback: InstallationCallback,
)
pub fn register_installation_callback( &self, id: &str, callback: InstallationCallback, )
注册安装事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”);callback - 回调函数。
Sourcepub fn unregister_installation_callback(&self, id: &str)
pub fn unregister_installation_callback(&self, id: &str)
注销安装事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”)。
Sourcepub fn register_focus_callback(&self, id: &str, callback: FocusCallback)
pub fn register_focus_callback(&self, id: &str, callback: FocusCallback)
注册焦点事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”);callback - 回调函数。
Sourcepub fn unregister_focus_callback(&self, id: &str)
pub fn unregister_focus_callback(&self, id: &str)
注销焦点事件回调。 参数:id - 回调标识(自动前缀化为 “{plugin_id}:{id}”)。
Auto Trait Implementations§
impl !Freeze for PluginHandle
impl !RefUnwindSafe for PluginHandle
impl !UnwindSafe for PluginHandle
impl Send for PluginHandle
impl Sync for PluginHandle
impl Unpin for PluginHandle
impl UnsafeUnpin for PluginHandle
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T, C> ComponentsInto<C> for T
impl<T, C> ComponentsInto<C> for T
Source§fn components_into(self) -> C
fn components_into(self) -> C
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.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> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
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