Struct quickjs_runtime::facades::QuickJsRuntimeFacade
source · pub struct QuickJsRuntimeFacade { /* private fields */ }
Expand description
EsRuntime is the main public struct representing a JavaScript runtime. You can construct a new QuickJsRuntime by using the QuickJsRuntimeBuilder struct
§Example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
let rt = QuickJsRuntimeBuilder::new().build();
Implementations§
source§impl QuickJsRuntimeFacade
impl QuickJsRuntimeFacade
sourcepub async fn memory_usage(&self) -> MemoryUsage
pub async fn memory_usage(&self) -> MemoryUsage
get memory usage for this runtime
sourcepub fn add_task_to_event_loop_void<C>(&self, task: C)
pub fn add_task_to_event_loop_void<C>(&self, task: C)
this can be used to run a function in the event_queue thread for the QuickJSRuntime without borrowing the q_js_rt
pub fn exe_task_in_event_loop<C, R: Send + 'static>(&self, task: C) -> R
pub fn add_task_to_event_loop<C, R: Send + 'static>( &self, task: C, ) -> impl Future<Output = R>
sourcepub fn add_rt_task_to_event_loop<C, R: Send + 'static>(
&self,
task: C,
) -> impl Future<Output = R>
pub fn add_rt_task_to_event_loop<C, R: Send + 'static>( &self, task: C, ) -> impl Future<Output = R>
this is how you add a closure to the worker thread which has an instance of the QuickJsRuntime this will run asynchronously
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
let rt = QuickJsRuntimeBuilder::new().build();
rt.add_rt_task_to_event_loop(|q_js_rt| {
// here you are in the worker thread and you can use the quickjs_utils
q_js_rt.gc();
});
pub fn add_rt_task_to_event_loop_void<C>(&self, task: C)
pub fn builder() -> QuickJsRuntimeBuilder
sourcepub fn exe_rt_task_in_event_loop<C, R>(&self, consumer: C) -> R
pub fn exe_rt_task_in_event_loop<C, R>(&self, consumer: C) -> R
this is how you add a closure to the worker thread which has an instance of the QuickJsRuntime this will run and return synchronously
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::quickjs_utils::primitives;
let rt = QuickJsRuntimeBuilder::new().build();
let res = rt.exe_rt_task_in_event_loop(|q_js_rt| {
let q_ctx = q_js_rt.get_main_realm();
// here you are in the worker thread and you can use the quickjs_utils
let val_ref = q_ctx.eval(Script::new("test.es", "(11 * 6);")).ok().expect("script failed");
primitives::to_i32(&val_ref).ok().expect("could not get i32")
});
assert_eq!(res, 66);
sourcepub fn set_function<F>(
&self,
namespace: &[&str],
name: &str,
function: F,
) -> Result<(), JsError>where
F: Fn(&QuickJsRealmAdapter, Vec<JsValueFacade>) -> Result<JsValueFacade, JsError> + Send + 'static,
pub fn set_function<F>(
&self,
namespace: &[&str],
name: &str,
function: F,
) -> Result<(), JsError>where
F: Fn(&QuickJsRealmAdapter, Vec<JsValueFacade>) -> Result<JsValueFacade, JsError> + Send + 'static,
this adds a rust function to JavaScript, it is added for all current and future contexts
§Example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::quickjs_utils::primitives;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::values::{JsValueConvertable, JsValueFacade};
let rt = QuickJsRuntimeBuilder::new().build();
rt.set_function(&["com", "mycompany", "util"], "methodA", |q_ctx, args: Vec<JsValueFacade>|{
let a = args[0].get_i32();
let b = args[1].get_i32();
Ok((a * b).to_js_value_facade())
}).expect("set func failed");
let res = rt.eval_sync(None, Script::new("test.es", "let a = com.mycompany.util.methodA(13, 17); a * 2;")).ok().expect("script failed");
assert_eq!(res.get_i32(), (13*17*2));
sourcepub fn add_helper_task<T>(task: T)
pub fn add_helper_task<T>(task: T)
add a task the the “helper” thread pool
sourcepub fn add_helper_task_async<R: Send + 'static, T: Future<Output = R> + Send + 'static>(
task: T,
) -> impl Future<Output = Result<R, JoinError>>
pub fn add_helper_task_async<R: Send + 'static, T: Future<Output = R> + Send + 'static>( task: T, ) -> impl Future<Output = Result<R, JoinError>>
add an async task the the “helper” thread pool
sourcepub fn create_context(&self, id: &str) -> Result<(), JsError>
pub fn create_context(&self, id: &str) -> Result<(), JsError>
create a new context besides the always existing main_context
§Example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
let rt = QuickJsRuntimeBuilder::new().build();
rt.create_context("my_context");
rt.exe_rt_task_in_event_loop(|q_js_rt| {
let my_ctx = q_js_rt.get_context("my_context");
my_ctx.eval(Script::new("ctx_test.es", "this.myVar = 'only exists in my_context';"));
});
sourcepub fn drop_context(&self, id: &str)
pub fn drop_context(&self, id: &str)
drop a context which was created earlier with a call to create_context()
source§impl QuickJsRuntimeFacade
impl QuickJsRuntimeFacade
pub fn create_realm(&self, name: &str) -> Result<(), JsError>
pub fn destroy_realm(&self, name: &str) -> Result<(), JsError>
pub fn has_realm(&self, name: &str) -> Result<bool, JsError>
sourcepub fn loop_sync<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter) -> R + Send + 'static>(
&self,
consumer: C,
) -> R
pub fn loop_sync<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter) -> R + Send + 'static>( &self, consumer: C, ) -> R
add a job to the eventloop which will execute sync(placed at end of eventloop)
pub fn loop_sync_mut<R: Send + 'static, C: FnOnce(&mut QuickJsRuntimeAdapter) -> R + Send + 'static>( &self, consumer: C, ) -> R
sourcepub fn loop_async<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter) -> R + Send + 'static>(
&self,
consumer: C,
) -> Pin<Box<dyn Future<Output = R> + Send>>
pub fn loop_async<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter) -> R + Send + 'static>( &self, consumer: C, ) -> Pin<Box<dyn Future<Output = R> + Send>>
add a job to the eventloop which will execute async(placed at end of eventloop) returns a Future which can be waited ob with .await
sourcepub fn loop_void<C: FnOnce(&QuickJsRuntimeAdapter) + Send + 'static>(
&self,
consumer: C,
)
pub fn loop_void<C: FnOnce(&QuickJsRuntimeAdapter) + Send + 'static>( &self, consumer: C, )
add a job to the eventloop (placed at end of eventloop) without expecting a result
sourcepub fn loop_realm_sync<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) -> R + Send + 'static>(
&self,
realm_name: Option<&str>,
consumer: C,
) -> R
pub fn loop_realm_sync<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) -> R + Send + 'static>( &self, realm_name: Option<&str>, consumer: C, ) -> R
add a job to the eventloop which will be executed synchronously (placed at end of eventloop)
sourcepub fn loop_realm<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) -> R + Send + 'static>(
&self,
realm_name: Option<&str>,
consumer: C,
) -> Pin<Box<dyn Future<Output = R>>>
pub fn loop_realm<R: Send + 'static, C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) -> R + Send + 'static>( &self, realm_name: Option<&str>, consumer: C, ) -> Pin<Box<dyn Future<Output = R>>>
add a job to the eventloop which will be executed async (placed at end of eventloop) returns a Future which can be waited ob with .await
sourcepub fn loop_realm_void<C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) + Send + 'static>(
&self,
realm_name: Option<&str>,
consumer: C,
)
pub fn loop_realm_void<C: FnOnce(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) + Send + 'static>( &self, realm_name: Option<&str>, consumer: C, )
add a job for a specific realm without expecting a result. the job will be added to the end of the eventloop
sourcepub fn eval(
&self,
realm_name: Option<&str>,
script: Script,
) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
pub fn eval( &self, realm_name: Option<&str>, script: Script, ) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
Evaluate a script asynchronously
§Example
use futures::executor::block_on;
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
let rt = QuickJsRuntimeBuilder::new().build();
let my_script = r#"
console.log("i'm a script");
"#;
block_on(rt.eval(None, Script::new("my_script.js", my_script))).expect("script failed");
sourcepub fn eval_sync(
&self,
realm_name: Option<&str>,
script: Script,
) -> Result<JsValueFacade, JsError>
pub fn eval_sync( &self, realm_name: Option<&str>, script: Script, ) -> Result<JsValueFacade, JsError>
Evaluate a script and return the result synchronously
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
let rt = QuickJsRuntimeBuilder::new().build();
let script = Script::new("my_file.js", "(9 * 3);");
let res = rt.eval_sync(None, script).ok().expect("script failed");
assert_eq!(res.get_i32(), 27);
sourcepub fn eval_module(
&self,
realm_name: Option<&str>,
script: Script,
) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
pub fn eval_module( &self, realm_name: Option<&str>, script: Script, ) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
evaluate a module, you need this if you want to compile a script that contains static imports e.g.
import {util} from 'file.js';
console.log(util(1, 2, 3));
please note that the module is cached under the absolute path you passed in the Script object and thus you should take care to make the path unique (hence the absolute_ name) also to use this you need to build the QuickJsRuntimeFacade with a module loader
§example
use futures::executor::block_on;
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::modules::ScriptModuleLoader;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::quickjsrealmadapter::QuickJsRealmAdapter;
struct TestModuleLoader {}
impl ScriptModuleLoader for TestModuleLoader {
fn normalize_path(&self, _realm: &QuickJsRealmAdapter, ref_path: &str,path: &str) -> Option<String> {
Some(path.to_string())
}
fn load_module(&self, _realm: &QuickJsRealmAdapter, absolute_path: &str) -> String {
"export const util = function(a, b, c){return a+b+c;};".to_string()
}
}
let rt = QuickJsRuntimeBuilder::new().script_module_loader(TestModuleLoader{}).build();
let script = Script::new("/opt/files/my_module.js", r#"
import {util} from 'other_module.js';\n
console.log(util(1, 2, 3));
"#);
// in real life you would .await this
let _res = block_on(rt.eval_module(None, script));
sourcepub fn eval_module_sync(
&self,
realm_name: Option<&str>,
script: Script,
) -> Result<JsValueFacade, JsError>
pub fn eval_module_sync( &self, realm_name: Option<&str>, script: Script, ) -> Result<JsValueFacade, JsError>
evaluate a module synchronously, you need this if you want to compile a script that contains static imports e.g.
import {util} from 'file.js';
console.log(util(1, 2, 3));
please note that the module is cached under the absolute path you passed in the Script object and thus you should take care to make the path unique (hence the absolute_ name) also to use this you need to build the QuickJsRuntimeFacade with a module loader
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::modules::ScriptModuleLoader;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::quickjsrealmadapter::QuickJsRealmAdapter;
struct TestModuleLoader {}
impl ScriptModuleLoader for TestModuleLoader {
fn normalize_path(&self, _realm: &QuickJsRealmAdapter, ref_path: &str,path: &str) -> Option<String> {
Some(path.to_string())
}
fn load_module(&self, _realm: &QuickJsRealmAdapter, absolute_path: &str) -> String {
"export const util = function(a, b, c){return a+b+c;};".to_string()
}
}
let rt = QuickJsRuntimeBuilder::new().script_module_loader(TestModuleLoader{}).build();
let script = Script::new("/opt/files/my_module.js", r#"
import {util} from 'other_module.js';\n
console.log(util(1, 2, 3));
"#);
let _res = rt.eval_module_sync(None, script);
sourcepub fn invoke_function_sync(
&self,
realm_name: Option<&str>,
namespace: &[&str],
method_name: &str,
args: Vec<JsValueFacade>,
) -> Result<JsValueFacade, JsError>
pub fn invoke_function_sync( &self, realm_name: Option<&str>, namespace: &[&str], method_name: &str, args: Vec<JsValueFacade>, ) -> Result<JsValueFacade, JsError>
invoke a function in the engine and get the result synchronously
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::values::JsValueConvertable;
let rt = QuickJsRuntimeBuilder::new().build();
let script = Script::new("my_file.es", "this.com = {my: {methodA: function(a, b, someStr, someBool){return a*b;}}};");
rt.eval_sync(None, script).ok().expect("script failed");
let res = rt.invoke_function_sync(None, &["com", "my"], "methodA", vec![7i32.to_js_value_facade(), 5i32.to_js_value_facade(), "abc".to_js_value_facade(), true.to_js_value_facade()]).ok().expect("func failed");
assert_eq!(res.get_i32(), 35);
sourcepub fn invoke_function(
&self,
realm_name: Option<&str>,
namespace: &[&str],
method_name: &str,
args: Vec<JsValueFacade>,
) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
pub fn invoke_function( &self, realm_name: Option<&str>, namespace: &[&str], method_name: &str, args: Vec<JsValueFacade>, ) -> Pin<Box<dyn Future<Output = Result<JsValueFacade, JsError>>>>
invoke a function in the engine asynchronously N.B. func_name is not a &str because of https://github.com/rust-lang/rust/issues/56238 (i think)
§example
use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use quickjs_runtime::jsutils::Script;
use quickjs_runtime::values::JsValueConvertable;
let rt = QuickJsRuntimeBuilder::new().build();
let script = Script::new("my_file.es", "this.com = {my: {methodA: function(a, b){return a*b;}}};");
rt.eval_sync(None, script).ok().expect("script failed");
rt.invoke_function(None, &["com", "my"], "methodA", vec![7.to_js_value_facade(), 5.to_js_value_facade()]);
pub fn invoke_function_void( &self, realm_name: Option<&str>, namespace: &[&str], method_name: &str, args: Vec<JsValueFacade>, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuickJsRuntimeFacade
impl !RefUnwindSafe for QuickJsRuntimeFacade
impl Send for QuickJsRuntimeFacade
impl Sync for QuickJsRuntimeFacade
impl Unpin for QuickJsRuntimeFacade
impl !UnwindSafe for QuickJsRuntimeFacade
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
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>
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<D> OwoColorize for D
impl<D> OwoColorize for D
source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read moresource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more