pub struct ContextFactory { /* private fields */ }Expand description
Implementations§
Source§impl ContextFactory
impl ContextFactory
Sourcepub fn new(
inproc_gate: OutGate,
shell_to_workload: Arc<InprocTransportManager>,
workload_to_shell: Arc<InprocTransportManager>,
data_stream_registry: Arc<DataStreamRegistry>,
media_frame_registry: Arc<MediaFrameRegistry>,
signaling_client: Arc<dyn SignalingClient>,
) -> Self
pub fn new( inproc_gate: OutGate, shell_to_workload: Arc<InprocTransportManager>, workload_to_shell: Arc<InprocTransportManager>, data_stream_registry: Arc<DataStreamRegistry>, media_frame_registry: Arc<MediaFrameRegistry>, signaling_client: Arc<dyn SignalingClient>, ) -> Self
创建新的 ContextFactory
§参数
inproc_gate: 进程内通信 gate(Dest::Shell/Local)- 立即可用shell_to_workload: Shell → Workload 方向的传输管理器workload_to_shell: Workload → Shell 方向的传输管理器data_stream_registry: DataStream 回调注册表media_frame_registry: MediaTrack 回调注册表
§设计说明
- inproc_gate: 在 ActrSystem::new() 时创建,立即可用(Shell/Local 通信不需要 ActorId)
- outproc_gate: 初始为 None,在 ActrNode::start() WebRTC 初始化完成后设置
- 双向 InprocTransportManager: 确保 Shell 和 Workload 的 pending_requests 完全分离
- data_stream_registry: 管理 DataStream 回调,支持应用数据流传输
- media_frame_registry: 管理 MediaTrack 回调,支持 WebRTC 原生媒体流
Sourcepub fn set_outproc_gate(&mut self, gate: OutGate)
pub fn set_outproc_gate(&mut self, gate: OutGate)
Sourcepub fn set_actr_lock(&mut self, actr_lock: LockFile)
pub fn set_actr_lock(&mut self, actr_lock: LockFile)
Sourcepub fn set_config_dir(&mut self, config_dir: PathBuf)
pub fn set_config_dir(&mut self, config_dir: PathBuf)
Sourcepub fn shell_to_workload(&self) -> Arc<InprocTransportManager>
pub fn shell_to_workload(&self) -> Arc<InprocTransportManager>
获取 Shell → Workload 方向的传输管理器
Sourcepub fn workload_to_shell(&self) -> Arc<InprocTransportManager>
pub fn workload_to_shell(&self) -> Arc<InprocTransportManager>
获取 Workload → Shell 方向的传输管理器
Sourcepub fn create(
&self,
self_id: &ActrId,
caller_id: Option<&ActrId>,
request_id: &str,
credential: &AIdCredential,
) -> RuntimeContext
pub fn create( &self, self_id: &ActrId, caller_id: Option<&ActrId>, request_id: &str, credential: &AIdCredential, ) -> RuntimeContext
Sourcepub fn create_bootstrap(
&self,
self_id: &ActrId,
credential: &AIdCredential,
) -> RuntimeContext
pub fn create_bootstrap( &self, self_id: &ActrId, credential: &AIdCredential, ) -> RuntimeContext
Trait Implementations§
Source§impl Clone for ContextFactory
impl Clone for ContextFactory
Source§fn clone(&self) -> ContextFactory
fn clone(&self) -> ContextFactory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextFactory
impl !RefUnwindSafe for ContextFactory
impl Send for ContextFactory
impl Sync for ContextFactory
impl Unpin for ContextFactory
impl !UnwindSafe for ContextFactory
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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