pub struct ForgeAsyncRuntime { /* private fields */ }
Expand description
Editor 结构体代表编辑器的核心功能实现 负责管理文档状态、事件处理、插件系统和存储等核心功能
Implementations§
Source§impl ForgeAsyncRuntime
impl ForgeAsyncRuntime
Sourcepub async fn create(options: RuntimeOptions) -> ForgeResult<Self>
pub async fn create(options: RuntimeOptions) -> ForgeResult<Self>
创建新的编辑器实例 options: 编辑器配置选项
Sourcepub fn set_performance_config(&mut self, config: PerformanceConfig)
pub fn set_performance_config(&mut self, config: PerformanceConfig)
设置性能监控配置
pub async fn command(&mut self, command: Arc<dyn Command>) -> ForgeResult<()>
Sourcepub async fn command_with_meta(
&mut self,
command: Arc<dyn Command>,
description: String,
meta: Value,
) -> ForgeResult<()>
pub async fn command_with_meta( &mut self, command: Arc<dyn Command>, description: String, meta: Value, ) -> ForgeResult<()>
pub async fn dispatch_flow( &mut self, transaction: Transaction, ) -> ForgeResult<()>
Sourcepub async fn dispatch_flow_with_meta(
&mut self,
transaction: Transaction,
description: String,
meta: Value,
) -> ForgeResult<()>
pub async fn dispatch_flow_with_meta( &mut self, transaction: Transaction, description: String, meta: Value, ) -> ForgeResult<()>
pub async fn run_before_middleware( &mut self, transaction: &mut Transaction, ) -> ForgeResult<()>
pub async fn run_after_middleware( &mut self, state: &mut Option<Arc<State>>, transactions: &mut Vec<Transaction>, ) -> ForgeResult<()>
Methods from Deref<Target = ForgeRuntime>§
Sourcepub async fn destroy(&mut self) -> ForgeResult<()>
pub async fn destroy(&mut self) -> ForgeResult<()>
销毁编辑器实例
pub async fn emit_event(&mut self, event: Event) -> ForgeResult<()>
pub async fn run_before_middleware( &mut self, transaction: &mut Transaction, ) -> ForgeResult<()>
pub async fn run_after_middleware( &mut self, state: &mut Option<Arc<State>>, transactions: &mut Vec<Transaction>, ) -> ForgeResult<()>
pub async fn command(&mut self, command: Arc<dyn Command>) -> ForgeResult<()>
pub async fn command_with_meta( &mut self, command: Arc<dyn Command>, description: String, meta: Value, ) -> ForgeResult<()>
Sourcepub async fn dispatch(&mut self, transaction: Transaction) -> ForgeResult<()>
pub async fn dispatch(&mut self, transaction: Transaction) -> ForgeResult<()>
Sourcepub async fn dispatch_with_meta(
&mut self,
transaction: Transaction,
description: String,
meta: Value,
) -> ForgeResult<()>
pub async fn dispatch_with_meta( &mut self, transaction: Transaction, description: String, meta: Value, ) -> ForgeResult<()>
更新编辑器状态并记录到历史记录 包含描述和元信息
Sourcepub async fn update_state(&mut self, state: Arc<State>) -> ForgeResult<()>
pub async fn update_state(&mut self, state: Arc<State>) -> ForgeResult<()>
更新编辑器状态并记录到历史记录 不包含描述和元信息
Sourcepub async fn update_state_with_meta(
&mut self,
state: Arc<State>,
description: String,
meta: Value,
) -> ForgeResult<()>
pub async fn update_state_with_meta( &mut self, state: Arc<State>, description: String, meta: Value, ) -> ForgeResult<()>
更新编辑器状态并记录到历史记录 包含描述和元信息
pub async fn register_plugin(&mut self) -> ForgeResult<()>
pub async fn unregister_plugin(&mut self, plugin_key: String) -> ForgeResult<()>
pub fn get_options(&self) -> &RuntimeOptions
pub fn get_state(&self) -> &Arc<State>
pub fn get_schema(&self) -> Arc<Schema>
pub fn get_event_bus(&self) -> &EventBus<Event>
pub fn get_tr(&self) -> Transaction
pub fn undo(&mut self)
pub fn redo(&mut self)
pub fn jump(&mut self, n: isize)
Trait Implementations§
Source§impl Deref for ForgeAsyncRuntime
impl Deref for ForgeAsyncRuntime
Source§impl DerefMut for ForgeAsyncRuntime
impl DerefMut for ForgeAsyncRuntime
impl Send for ForgeAsyncRuntime
impl Sync for ForgeAsyncRuntime
Auto Trait Implementations§
impl Freeze for ForgeAsyncRuntime
impl !RefUnwindSafe for ForgeAsyncRuntime
impl !Unpin for ForgeAsyncRuntime
impl !UnwindSafe for ForgeAsyncRuntime
Blanket Implementations§
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> 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> 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 more