pub struct ComponentImports { /* private fields */ }Expand description
A handle that can be used to call component imports such as ComponentImports::create_element
and ComponentImports::create_text.
§ComponentImports and Clone
Cloning a ComponentImports is cheap and does not allocate.
Implementations§
Source§impl ComponentImports
impl ComponentImports
Sourcepub fn create_element(&self, tag: &str) -> Option<DomElement>
pub fn create_element(&self, tag: &str) -> Option<DomElement>
Create a new DomElement.
Source§impl ComponentImports
impl ComponentImports
Sourcepub fn create_text(&self, text: &str) -> Option<DomText>
pub fn create_text(&self, text: &str) -> Option<DomText>
Create a new text node in the DOM.
Source§impl ComponentImports
impl ComponentImports
Sourcepub fn local_storage_get_item<'out>(
&self,
key: &str,
out_buffer: &'out mut [u8],
) -> Result<Option<&'out str>, LocalStorageGetItemError>
pub fn local_storage_get_item<'out>( &self, key: &str, out_buffer: &'out mut [u8], ) -> Result<Option<&'out str>, LocalStorageGetItemError>
Get an item from local storage.
Sourcepub fn local_storage_set_item(&self, key: &str, val: &str)
pub fn local_storage_set_item(&self, key: &str, val: &str)
Set an item in local storage.
Source§impl ComponentImports
impl ComponentImports
Sourcepub fn initialize_stripe<C: Context>(&self, context: C)
pub fn initialize_stripe<C: Context>(&self, context: C)
Initialize the Stripe JS SDK.
Sourcepub fn create_stripe_elements(
&self,
handle: &StripeJsSdkInstanceHandle,
amount_cents: u32,
) -> StripeElementsHandle
pub fn create_stripe_elements( &self, handle: &StripeJsSdkInstanceHandle, amount_cents: u32, ) -> StripeElementsHandle
Create a Stripe Elements object.
Sourcepub fn submit_stripe_elements<C: Context>(
&self,
handle: &StripeElementsHandle,
context: C,
)
pub fn submit_stripe_elements<C: Context>( &self, handle: &StripeElementsHandle, context: C, )
Submit a Stripe Elements object.
Source§impl ComponentImports
impl ComponentImports
Sourcepub fn output_may_have_changed(&self, output_id: i32)
pub fn output_may_have_changed(&self, output_id: i32)
Indicate that one of a component’s outputs may have changed.
Source§impl ComponentImports
impl ComponentImports
Sourcepub const fn new_dynamically_linked() -> Self
pub const fn new_dynamically_linked() -> Self
Create a new ComponentImports that makes calls to functions that are provided by the
Afia host.
Use [EmulatedImports::component_imports] to create ComponentImports during tests.
Trait Implementations§
Source§impl Clone for ComponentImports
impl Clone for ComponentImports
Source§fn clone(&self) -> ComponentImports
fn clone(&self) -> ComponentImports
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 moreSource§impl FromComponentOutputArgs for ComponentImports
impl FromComponentOutputArgs for ComponentImports
Source§fn from_args(args: ComponentOutputArgs) -> Self
fn from_args(args: ComponentOutputArgs) -> Self
Create the type using
ComponentOutputArgs.Auto Trait Implementations§
impl Freeze for ComponentImports
impl RefUnwindSafe for ComponentImports
impl !Send for ComponentImports
impl !Sync for ComponentImports
impl Unpin for ComponentImports
impl UnsafeUnpin for ComponentImports
impl UnwindSafe for ComponentImports
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