pub struct SharedEnv { /* private fields */ }Expand description
A structure of shared environment.
The shared environment is part of an environment that has global properities which can be shared between different environments. These global properties are library paths and documentation paths, arguments, used libraries, test suites, an event loop proxy, and other properties. The event loop proxy is used to communication to with the main thread from the windows.
Implementations§
Sourcepub fn new_with_intr_checker_and_event_loop_proxy(
lib_path: OsString,
doc_path: OsString,
args: Vec<String>,
intr_checker: Arc<dyn IntrCheck + Send + Sync>,
event_loop_proxy: Option<EventLoopProxy>,
) -> Self
pub fn new_with_intr_checker_and_event_loop_proxy( lib_path: OsString, doc_path: OsString, args: Vec<String>, intr_checker: Arc<dyn IntrCheck + Send + Sync>, event_loop_proxy: Option<EventLoopProxy>, ) -> Self
Creates a shared environment with the interrruption checker and the event loop proxy.
Also, this method takes the paths of the libraries and the documentations and the arguments.
Sourcepub fn new_with_intr_checker(
lib_path: OsString,
doc_path: OsString,
args: Vec<String>,
intr_checker: Arc<dyn IntrCheck + Send + Sync>,
) -> Self
pub fn new_with_intr_checker( lib_path: OsString, doc_path: OsString, args: Vec<String>, intr_checker: Arc<dyn IntrCheck + Send + Sync>, ) -> Self
Creates a shared environment with the interrruption checker.
Sourcepub fn new(lib_path: OsString, doc_path: OsString, args: Vec<String>) -> Self
pub fn new(lib_path: OsString, doc_path: OsString, args: Vec<String>) -> Self
Creates a shared environment.
Sourcepub fn has_used_lib(&self, lib: &String) -> bool
pub fn has_used_lib(&self, lib: &String) -> bool
Returns true if the shared environment has the used libraries, otherwise false.
Sourcepub fn add_used_lib(&mut self, lib: String)
pub fn add_used_lib(&mut self, lib: String)
Adds used library to the shared environment.
Sourcepub fn remove_used_lib(&mut self, lib: &String)
pub fn remove_used_lib(&mut self, lib: &String)
Removes used library from the shared environment.
Sourcepub fn test_suites(&self) -> &HashSet<Vec<String>>
pub fn test_suites(&self) -> &HashSet<Vec<String>>
Returns the test suites.
Sourcepub fn has_test_suite(&self, idents: &Vec<String>) -> bool
pub fn has_test_suite(&self, idents: &Vec<String>) -> bool
Returns true if the shared environment has the test suite, otherwise false.
Sourcepub fn add_test_suite(&mut self, idents: Vec<String>)
pub fn add_test_suite(&mut self, idents: Vec<String>)
Adds test suite to the shared environment.
Sourcepub fn remove_test_suite(&mut self, idents: &Vec<String>)
pub fn remove_test_suite(&mut self, idents: &Vec<String>)
Removes test suite from the shared environment.
Sourcepub fn intr_checker(&self) -> &Arc<dyn IntrCheck + Send + Sync>
pub fn intr_checker(&self) -> &Arc<dyn IntrCheck + Send + Sync>
Returns the interruption checker.
Sourcepub fn event_loop_proxy(&self) -> Option<&EventLoopProxy>
pub fn event_loop_proxy(&self) -> Option<&EventLoopProxy>
Returns the event loop proxy if the shared environment has the event loop proxy, otherwise
None.
Trait Implementations§
Auto Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.