Struct HermesRuntime

Source
pub struct HermesRuntime {
    pub runtime: Arc<Runtime>,
}

Fields§

§runtime: Arc<Runtime>

Implementations§

Source§

impl HermesRuntime

Source

pub fn new(runtime: Arc<Runtime>) -> Self

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Runtime> CanCloneSender for Runtime
where Runtime: HasChannelTypes + HasComponents, <Runtime as HasComponents>::Components: SenderCloner<Runtime>,

Source§

fn clone_sender<T>( sender: &<Runtime as HasChannelTypes>::Sender<T>, ) -> <Runtime as HasChannelTypes>::Sender<T>
where T: Async,

Source§

impl<Runtime> CanCopyFile for Runtime
where Runtime: HasFilePathType + HasErrorType + HasComponents, <Runtime as HasComponents>::Components: FileCopier<Runtime>,

Source§

async fn copy_file( &self, source_path: &<Runtime as HasFilePathType>::FilePath, destination_path: &<Runtime as HasFilePathType>::FilePath, ) -> Result<(), <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanCreateChannels for Runtime
where Runtime: HasChannelTypes + HasComponents, <Runtime as HasComponents>::Components: ChannelCreator<Runtime>,

Source§

fn new_channel<T>() -> (<Runtime as HasChannelTypes>::Sender<T>, <Runtime as HasChannelTypes>::Receiver<T>)
where T: Async,

Given a generic payload type T, create a Sender<T> and Receiver<T> pair that are connected. Read more
Source§

impl<Runtime> CanCreateChannelsOnce for Runtime

Source§

fn new_channel_once<T>() -> (<Runtime as HasChannelOnceTypes>::SenderOnce<T>, <Runtime as HasChannelOnceTypes>::ReceiverOnce<T>)
where T: Async,

Source§

impl<Runtime> CanCreateClosureSubscription for Runtime
where Runtime: HasMutex,

Source§

fn new_closure_subscription<T>( subscribe: impl Fn() -> Pin<Box<dyn Future<Output = Option<Pin<Box<dyn Stream<Item = T> + Sync + Send>>>> + Send>> + Send + Sync + 'static, ) -> Arc<dyn Subscription<Item = T>>
where T: Async,

Source§

impl<Runtime> CanCreateDir for Runtime
where Runtime: HasFilePathType + HasErrorType + HasComponents, <Runtime as HasComponents>::Components: DirCreator<Runtime>,

Source§

async fn create_dir( &self, dir_path: &<Runtime as HasFilePathType>::FilePath, ) -> Result<(), <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanExecCommand for Runtime

Source§

async fn exec_command( &self, command_path: &<Runtime as HasFilePathType>::FilePath, args: &[&str], ) -> Result<ExecOutput, <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanExecCommandWithEnvs for Runtime

Source§

async fn exec_command_with_envs( &self, command_path: &<Runtime as HasFilePathType>::FilePath, args: &[&str], envs: &[(&str, &str)], ) -> Result<ExecOutput, <Runtime as HasErrorType>::Error>

Source§

impl<Runtime, T> CanGenerateRandom<T> for Runtime
where T: Async, Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: RandomGenerator<Runtime, T>,

Source§

async fn generate_random(&self) -> T

Source§

async fn random_range(&self, min: T, max: T) -> T

Source§

impl<Runtime> CanMapStream for Runtime
where Runtime: HasStreamType + HasComponents, <Runtime as HasComponents>::Components: StreamMapper<Runtime>,

Source§

fn map_stream<T, U, M>( stream: <Runtime as HasStreamType>::Stream<T>, mapper: M, ) -> <Runtime as HasStreamType>::Stream<U>
where T: Async, U: Async, M: Fn(T) -> U + Async,

Source§

impl<Runtime> CanMultiplexSubscription for Runtime

Source§

fn multiplex_subscription<T, U>( &self, subscription: impl Subscription<Item = T>, mapper: impl Fn(T) -> U + Async, ) -> Arc<dyn Subscription<Item = U>>
where T: Async + Clone, U: Async + Clone,

Multiplex a given subscription, with a mapper function that maps the item coming from the underlying subscription from T to U. Returns a new multiplexed subscription that shares the same underlying Stream.
Source§

impl<Runtime> CanPipeReaderToFile for Runtime

Source§

async fn pipe_reader_to_file( &self, reader: impl AsyncRead + Unpin + Send + Sync + 'static, file_path: &<Runtime as HasFilePathType>::FilePath, ) -> Result<(), <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanReadFileAsString for Runtime

Source§

async fn read_file_as_string( &self, file_path: &<Runtime as HasFilePathType>::FilePath, ) -> Result<String, <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanReserveTcpPort for Runtime
where Runtime: Async + HasErrorType + HasComponents, <Runtime as HasComponents>::Components: TcpPortReserver<Runtime>,

Source§

async fn reserve_tcp_port( &self, ) -> Result<u16, <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanRunConcurrentTasks for Runtime
where Runtime: HasStreamType + HasComponents, <Runtime as HasComponents>::Components: ConcurrentTaskRunner<Runtime>,

Source§

async fn run_concurrent_tasks<T>(&self, tasks: Vec<T>)
where T: Task,

Source§

async fn run_concurrent_task_stream<T>( &self, tasks: <Runtime as HasStreamType>::Stream<T>, )
where T: Task,

Source§

impl<Runtime> CanSleep for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: Sleeper<Runtime>,

Source§

async fn sleep(&self, duration: Duration)

Source§

impl<Runtime> CanSpawnTask for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: TaskSpawner<Runtime>,

Source§

fn spawn_task<T>(&self, task: T)
where T: Task,

Source§

impl<Runtime> CanStartChildProcess for Runtime

Source§

async fn start_child_process( &self, command_path: &<Runtime as HasFilePathType>::FilePath, command_args: &[&str], envs: &[(&str, &str)], stdout_path: Option<&<Runtime as HasFilePathType>::FilePath>, stderr_path: Option<&<Runtime as HasFilePathType>::FilePath>, ) -> Result<<Runtime as HasChildProcessType>::ChildProcess, <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanStreamReceiver for Runtime

Source§

fn receiver_to_stream<T>( receiver: <Runtime as HasChannelTypes>::Receiver<T>, ) -> <Runtime as HasStreamType>::Stream<T>
where T: Async,

Source§

impl<Runtime> CanStreamSubscription for Runtime

Source§

fn stream_subscription<S, T>( &self, stream: S, ) -> Arc<dyn Subscription<Item = T>>
where S: Stream<Item = T> + Async, T: Async + Clone,

Source§

impl<Runtime> CanUseChannels for Runtime
where Runtime: HasChannelTypes + HasErrorType + HasComponents, <Runtime as HasComponents>::Components: ChannelUser<Runtime>,

Source§

async fn send<T>( sender: &<Runtime as HasChannelTypes>::Sender<T>, value: T, ) -> Result<(), <Runtime as HasErrorType>::Error>
where T: Async,

Given a reference to Sender<T>, send a message payload of type T over the sender. Read more
Source§

async fn receive<T>( receiver: &mut <Runtime as HasChannelTypes>::Receiver<T>, ) -> Result<T, <Runtime as HasErrorType>::Error>
where T: Async,

Given a reference to Receiver<T>, asynchronously receive a message payload of type T that is sent over the sender end. Read more
Source§

fn try_receive<T>( receiver: &mut <Runtime as HasChannelTypes>::Receiver<T>, ) -> Result<Option<T>, <Runtime as HasErrorType>::Error>
where T: Async,

Source§

impl<Runtime> CanUseChannelsOnce for Runtime

Source§

fn send_once<T>( sender: <Runtime as HasChannelOnceTypes>::SenderOnce<T>, value: T, ) -> Result<(), <Runtime as HasErrorType>::Error>
where T: Async,

Source§

async fn receive_once<T>( receiver: <Runtime as HasChannelOnceTypes>::ReceiverOnce<T>, ) -> Result<T, <Runtime as HasErrorType>::Error>
where T: Async,

Source§

impl<Runtime> CanWaitChildProcess for Runtime

Source§

async fn wait_child_process( child_process: <Runtime as HasChildProcessType>::ChildProcess, ) -> Result<(), <Runtime as HasErrorType>::Error>

Source§

impl<Runtime> CanWriteStringToFile for Runtime

Source§

async fn write_string_to_file( &self, path: &<Runtime as HasFilePathType>::FilePath, content: &str, ) -> Result<(), <Runtime as HasErrorType>::Error>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<Runtime, Components> HasBoxedStreamType for Runtime
where Runtime: Async + HasComponents<Components = Components>, Components: BoxedStreamTypeProvider<Runtime>,

Source§

fn to_boxed_stream<Item>( stream: <Runtime as HasStreamType>::Stream<Item>, ) -> Pin<Box<dyn Stream<Item = Item> + Sync + Send>>
where Item: Async,

Source§

fn from_boxed_stream<Item>( stream: Pin<Box<dyn Stream<Item = Item> + Sync + Send>>, ) -> <Runtime as HasStreamType>::Stream<Item>
where Item: Async,

Source§

impl<Runtime> HasChannelOnceTypes for Runtime
where Runtime: HasComponents, <Runtime as HasComponents>::Components: ProvideChannelOnceType<Runtime>,

Source§

impl<Runtime> HasChannelTypes for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideChannelType<Runtime>,

Source§

type Sender<T: Async> = <<Runtime as HasComponents>::Components as ProvideChannelType<Runtime>>::Sender<T>

The sender end of a channel with payload type T.

Source§

type Receiver<T: Async> = <<Runtime as HasComponents>::Components as ProvideChannelType<Runtime>>::Receiver<T>

The receiver end of a channel with payload type T.

Source§

impl<Runtime> HasChildProcessType for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideChildProcessType<Runtime>,

Source§

impl<Context> HasErrorType for Context
where Context: HasComponents, <Context as HasComponents>::Components: ProvideErrorType<Context>,

Source§

type Error = <<Context as HasComponents>::Components as ProvideErrorType<Context>>::Error

The Error associated type is also required to implement Debug.

This is to allow Self::Error to be used in calls like .unwrap(), as well as for simpler error logging.

Source§

impl<Runtime> HasFilePathType for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideFilePathType<Runtime>,

Source§

impl<Runtime> HasMutex for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideMutex<Runtime>,

Source§

type Mutex<T: Async> = <<Runtime as HasComponents>::Components as ProvideMutex<Runtime>>::Mutex<T>

Source§

type MutexGuard<'a, T: Async> = <<Runtime as HasComponents>::Components as ProvideMutex<Runtime>>::MutexGuard<'a, T>

Source§

fn new_mutex<T>(item: T) -> <Runtime as HasMutex>::Mutex<T>
where T: Async,

Source§

async fn acquire_mutex<'a, T>( mutex: &'a <Runtime as HasMutex>::Mutex<T>, ) -> <Runtime as HasMutex>::MutexGuard<'a, T>
where T: Async,

Source§

impl<Runtime, Components> HasOneShotChannelType for Runtime
where Runtime: HasComponents<Components = Components>, Components: OneShotChannelTypeProvider<Runtime>,

Source§

fn from_oneshot_sender<T>( sender: Sender<T>, ) -> <Runtime as HasChannelOnceTypes>::SenderOnce<T>
where T: Async,

Source§

fn from_oneshot_receiver<T>( receiver: Receiver<T>, ) -> <Runtime as HasChannelOnceTypes>::ReceiverOnce<T>
where T: Async,

Source§

fn to_oneshot_sender<T>( sender: <Runtime as HasChannelOnceTypes>::SenderOnce<T>, ) -> Sender<T>
where T: Async,

Source§

fn to_oneshot_receiver<T>( receiver: <Runtime as HasChannelOnceTypes>::ReceiverOnce<T>, ) -> Receiver<T>
where T: Async,

Source§

impl<Runtime> HasStreamType for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideStreamType<Runtime>,

Source§

type Stream<Item: Async> = <<Runtime as HasComponents>::Components as ProvideStreamType<Runtime>>::Stream<Item>

Source§

impl<Runtime> HasSubscription for Runtime
where Runtime: HasStreamType + HasComponents, <Runtime as HasComponents>::Components: ProvideSubscription<Runtime>,

Source§

type Subscription<Item: Async> = <<Runtime as HasComponents>::Components as ProvideSubscription<Runtime>>::Subscription<Item>

Source§

async fn subscribe<T>( subcription: &<Runtime as HasSubscription>::Subscription<T>, ) -> Option<<Runtime as HasStreamType>::Stream<T>>
where T: Async,

Source§

impl<Runtime> HasTime for Runtime
where Runtime: Async + HasComponents, <Runtime as HasComponents>::Components: ProvideTime<Runtime>,

Source§

type Time = <<Runtime as HasComponents>::Components as ProvideTime<Runtime>>::Time

Source§

fn now(&self) -> <Runtime as HasTime>::Time

Source§

fn duration_since( current_time: &<Runtime as HasTime>::Time, other_time: &<Runtime as HasTime>::Time, ) -> Duration

Source§

impl<Runtime, Components> HasUnboundedChannelType for Runtime
where Runtime: Async + HasComponents<Components = Components>, Components: UnboundedChannelTypeProvider<Runtime> + ProvideChannelType<Runtime>,

Source§

fn from_unbounded_sender<T>( sender: Arc<Mutex<UnboundedSender<T>>>, ) -> <Runtime as HasChannelTypes>::Sender<T>
where T: Async,

Source§

fn from_unbounded_receiver<T>( receiver: UnboundedReceiver<T>, ) -> <Runtime as HasChannelTypes>::Receiver<T>
where T: Async,

Source§

fn to_unbounded_receiver<T>( receiver: <Runtime as HasChannelTypes>::Receiver<T>, ) -> UnboundedReceiver<T>
where T: Async,

Source§

fn to_unbounded_sender_ref<T>( sender: &<Runtime as HasChannelTypes>::Sender<T>, ) -> &Arc<Mutex<UnboundedSender<T>>>
where T: Async,

Source§

fn to_unbounded_receiver_ref<T>( receiver: &mut <Runtime as HasChannelTypes>::Receiver<T>, ) -> &mut UnboundedReceiver<T>
where T: Async,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<A> Async for A
where A: Send + Sync + 'static,