pub struct ScriptMessage {
pub name: String,
pub payload: String,
pub origin: String,
pub main_frame: bool,
}Expand description
A message a page posted with window.dayMessage(name, payload)
(crate::WebView::on_script_message).
Every frame the message shim runs in can post one, ads and other third-party frames included. Treat the payload as untrusted input.
Fields§
§name: StringThe handler’s name.
payload: StringWhat the page sent, as text.
origin: StringThe security origin of the frame that sent it, where the engine vouches for it (WebKit, Android, WebView2); empty elsewhere.
main_frame: boolWhether the top-level document sent it.
Trait Implementations§
Source§impl Clone for ScriptMessage
impl Clone for ScriptMessage
Source§impl Debug for ScriptMessage
impl Debug for ScriptMessage
Source§impl<'de> Deserialize<'de> for ScriptMessage
impl<'de> Deserialize<'de> for ScriptMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ScriptMessage
Source§impl PartialEq for ScriptMessage
impl PartialEq for ScriptMessage
Source§impl Serialize for ScriptMessage
impl Serialize for ScriptMessage
impl StructuralPartialEq for ScriptMessage
Auto Trait Implementations§
impl Forget for ScriptMessage
impl Freeze for ScriptMessage
impl Move for ScriptMessage
impl RefUnwindSafe for ScriptMessage
impl Send for ScriptMessage
impl Sync for ScriptMessage
impl Unpin for ScriptMessage
impl UnsafeUnpin for ScriptMessage
impl UnwindSafe for ScriptMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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