text
stringlengths
8
4.13M
use libc::{c_int, c_uint, c_char, uint32_t}; pub type SDL_bool = c_int; pub type SDL_errorcode = c_uint; pub const SDL_ENOMEM: SDL_errorcode = 0; pub const SDL_EFREAD: SDL_errorcode = 1; pub const SDL_EFWRITE: SDL_errorcode = 2; pub const SDL_EFSEEK: SDL_errorcode = 3; pub const SDL_UNSUPPORTED: SDL_errorcode = 4; pub const SDL_LASTERROR: SDL_errorcode = 5; pub type SDL_InitFlag = uint32_t; pub const SDL_INIT_TIMER: SDL_InitFlag = 0x00000001; pub const SDL_INIT_AUDIO: SDL_InitFlag = 0x00000010; pub const SDL_INIT_VIDEO: SDL_InitFlag = 0x00000020; pub const SDL_INIT_JOYSTICK: SDL_InitFlag = 0x00000200; pub const SDL_INIT_HAPTIC: SDL_InitFlag = 0x00001000; pub const SDL_INIT_GAMECONTROLLER: SDL_InitFlag = 0x00002000; pub const SDL_INIT_EVENTS: SDL_InitFlag = 0x00004000; pub const SDL_INIT_NOPARACHUTE: SDL_InitFlag = 0x00100000; pub const SDL_INIT_EVERYTHING: SDL_InitFlag = 0x0000FFFF; //SDL_error.h extern "C" { pub fn SDL_ClearError(); pub fn SDL_Error(code: SDL_errorcode) -> c_int; pub fn SDL_SetError(fmt: *const c_char) -> c_int; pub fn SDL_GetError() -> *const c_char; //SDL.h pub fn SDL_Init(flags: uint32_t) -> c_int; pub fn SDL_InitSubSystem(flags: SDL_InitFlag) -> c_int; pub fn SDL_QuitSubSystem(flags: SDL_InitFlag); pub fn SDL_WasInit(flags: SDL_InitFlag) -> SDL_InitFlag; pub fn SDL_Quit(); }
pub struct Cli { pub schema_path: std::path::PathBuf, }
//! This module contains the tree connect contexts //! The SMB2_TREE_CONNECT_CONTEXT structure is used by the //! SMB2 TREE_CONNECT request and the SMB2 TREE_CONNECT response //! to encode additional properties. /// The SMB2_TREE_CONNECT_CONTEXT structure is used by the SMB2 TREE_CONNECT /// request and the SMB2 TREE_CONNECT response to encode additional properties. #[derive(Debug, PartialEq, Eq, Clone)] pub struct TreeConnectContext { /// ContextType (2 bytes): Specifies the type of context in the Data field. /// This field MUST be one of the types. context_type: Vec<u8>, /// DataLength (2 bytes): The length, in bytes, of the Data field. data_length: Vec<u8>, /// Reserved (4 bytes): This field MUST NOT be used and MUST be reserved. /// This value MUST be set to 0 by the client, and MUST be ignored by the server. reserved: Vec<u8>, /// Data (variable): A variable-length field that contains the tree connect context /// specified by the ContextType field. data: Option<ContextType>, } impl TreeConnectContext { /// Creates a new instance of the Tree Connect Context. pub fn default() -> Self { TreeConnectContext { context_type: Vec::new(), data_length: Vec::new(), reserved: b"\x00\x00\x00\x00".to_vec(), data: None, } } } /// *Reserved Tree Connect Context ID*: /// - This value is reserved. 0x0000 /// /// *Remoted Identity Tree Connect Context ID*: /// - The Data field contains remoted identity tree connect context data. #[derive(Debug, PartialEq, Eq, Clone)] pub enum ContextType { ReservedTreeConntectContextId, RemotedIdentityTreeConnectContextId(Box<RemotedIdentityTreeConnectContextId>), } /// The SMB2_REMOTED_IDENTITY_TREE_CONNECT context is specified in SMB2_TREE_CONNECT_CONTEXT /// structure when the ContextType is set to SMB2_REMOTED_IDENTITY_TREE_CONNECT_CONTEXT_ID. #[derive(Debug, PartialEq, Eq, Clone)] pub struct RemotedIdentityTreeConnectContextId { /// TicketType (2 bytes): A 16-bit integer specifying the type of ticket requested. /// The value in this field MUST be set to 0x0001. ticket_type: Vec<u8>, /// TicketSize (2 bytes): A 16-bit integer specifying the total size of this structure. ticket_size: Vec<u8>, /// User (2 bytes): A 16-bit integer specifying the offset, in bytes, from the beginning /// of this structure to the user information in the TicketInfo buffer. /// The user information is stored in SID_ATTR_DATA format. user: Vec<u8>, /// UserName (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the null-terminated Unicode string containing /// the username in the TicketInfo field. user_name: Vec<u8>, /// Domain (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the null-terminated Unicode string containing /// the domain name in the TicketInfo field. domain: Vec<u8>, /// Groups (2 bytes): A 16-bit integer specifying the offset, in bytes, from the beginning /// of this structure to the information about the groups in the TicketInfo buffer. /// The information is stored in SID_ARRAY_DATA format. groups: Vec<u8>, /// RestrictedGroups (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the restricted groups /// in the TicketInfo field. The information is stored in SID_ARRAY_DATA format. restricted_groups: Vec<u8>, /// Privileges (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the privileges /// in the TicketInfo field. The information is stored in PRIVILEGE_ARRAY_DATA format. privileges: Vec<u8>, /// PrimaryGroup (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the primary group /// in the TicketInfo field. The information is stored in SID_ARRAY_DATA format. primary_group: Vec<u8>, /// Owner (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the owner /// in the TicketInfo field. The information is stored in BLOB_DATA format, where /// BlobData contains the SID, representing the owner, and BlobSize contains the size of SID. owner: Vec<u8>, /// DefaultDacl (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the DACL, /// in the TicketInfo field. Information about the DACL is stored in BLOB_DATA format, /// where BlobSize contains the size of the ACL structure, and BlobData contains the DACL data. default_dacl: Vec<u8>, /// DeviceGroups (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the information about the device groups in the TicketInfo field. /// The information is stored in SID_ARRAY_DATA format. device_groups: Vec<u8>, /// UserClaims (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the user claims data in the TicketInfo field. /// Information about user claims is stored in BLOB_DATA format, where BlobData contains /// an array of CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 structures, representing the claims /// issued to the user, and BlobSize contains the size of the user claims data. user_claims: Vec<u8>, /// DeviceClaims (2 bytes): A 16-bit integer specifying the offset, in bytes, /// from the beginning of this structure to the device claims data in the TicketInfo field. /// Information about device claims is stored in BLOB_DATA format, where BlobData contains /// an array of CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 structures, representing the claims /// issued to the account of the device which the user is connected from, and BlobSize /// contains the size of the device claims data. device_claims: Vec<u8>, /// TicketInfo (variable): A variable-length buffer containing the remoted identity /// tree connect context data, including the information about all the previously /// defined fields in this structure. ticket_info: Vec<u8>, } impl RemotedIdentityTreeConnectContextId { /// Creates a new instance of Remoted Identity TreeConnect Context Id. pub fn default() -> Self { RemotedIdentityTreeConnectContextId { ticket_type: b"\x00\x01".to_vec(), ticket_size: Vec::new(), user: Vec::new(), user_name: Vec::new(), domain: Vec::new(), groups: Vec::new(), restricted_groups: Vec::new(), privileges: Vec::new(), primary_group: Vec::new(), owner: Vec::new(), default_dacl: Vec::new(), device_groups: Vec::new(), user_claims: Vec::new(), device_claims: Vec::new(), ticket_info: Vec::new(), } } } /// Contains information about the use in the ticket info. #[derive(Debug, PartialEq, Eq, Clone)] pub struct SidAttrData { /// SidData (variable): SID, information in BLOB_DATA format. /// BlobSize MUST be set to the size of SID and BlobData MUST be set to the SID value. sid_data: Vec<u8>, /// Attr (4 bytes): Specified attributes of the SID. attr: Vec<u8>, } impl SidAttrData { /// Creates a new instance of SID Attr Data. pub fn default() -> Self { SidAttrData { sid_data: Vec::new(), attr: Vec::new(), } } } #[derive(Debug, PartialEq, Eq, Clone)] pub enum Attr { GroupEnabled, GroupEnabledByDefault, GroupIntegrity, GroupIntegrityEnabled, GroupLogonId, GroupMandatory, GroupOwner, GroupResource, GroupUseForDenyOnly, } impl Attr { /// Unpacks the byte code for SID Attr. pub fn unpack_byte_code(&self) -> u32 { match self { Attr::GroupEnabled => 0x00000004, Attr::GroupEnabledByDefault => 0x00000002, Attr::GroupIntegrity => 0x00000020, Attr::GroupIntegrityEnabled => 0x00000040, Attr::GroupLogonId => 0xC0000000, Attr::GroupMandatory => 0x00000001, Attr::GroupOwner => 0x00000008, Attr::GroupResource => 0x20000000, Attr::GroupUseForDenyOnly => 0x00000010, } } } /// Represents information about owner, user and device claims, and default dacl /// in the ticket fields. #[derive(Debug, PartialEq, Eq, Clone)] pub struct BlobData { /// BlobSize (2 bytes): Size of the data, in bytes, in BlobData. blob_size: Vec<u8>, /// BlobData (variable): Blob data. blob_data: Vec<u8>, } impl BlobData { /// Creates a new instance of Blobdata. pub fn default() -> Self { BlobData { blob_size: Vec::new(), blob_data: Vec::new(), } } } #[derive(Debug, PartialEq, Eq, Clone)] pub struct SidArrayData { /// SidAttrCount (2 bytes): Number of SID_ATTR_DATA elements in SidAttrList array. sid_attr_count: Vec<u8>, /// SidAttrList (variable): An array with SidAttrCount number of SID_ATTR_DATA elements. sid_attr_list: Vec<SidAttrData>, } impl SidArrayData { /// Creates a new instance of SID Array Data. pub fn default() -> Self { SidArrayData { sid_attr_count: Vec::new(), sid_attr_list: Vec::new(), } } } /// Contains information about privileges with a unique id. #[derive(Debug, PartialEq, Eq, Clone)] pub struct LuidAttrData { /// Luid (8 bytes): Locally unique identifier luid: Vec<u8>, /// Attr (4 bytes): LUID attributes. /// The last two bits of the 32 bits contain the following values: /// - Second to last => D:The privilege is enabled by default. /// - Last => E:The privilege is enabled. /// - All other bits SHOULD be 0 and ignored upon receipt. attr: Vec<u8>, } impl LuidAttrData { /// Creates a new instance of LUID Attr Data. pub fn default() -> Self { LuidAttrData { luid: Vec::new(), attr: Vec::new(), } } } /// Contains privilege information about multiple users. #[derive(Debug, PartialEq, Eq, Clone)] pub struct PrivilegeArrayData { /// PrivilegeCount (2 bytes): Number of PRIVILEGE_DATA elements in PrivilegeList array. privilege_count: Vec<u8>, /// PrivilegeList (variable): An array with PrivilegeCount number of PRIVILEGE_DATA elements. /// PRIVILEGE_DATA takes the form BLOB_DATA. BlobSize MUST be set to the size of LUID_ATTR_DATA /// structure and BlobData MUST be set to the LUID_ATTR_DATA. privilege_list: Vec<BlobData>, } impl PrivilegeArrayData { /// Creates a new instance of Privilege Array Data. pub fn default() -> Self { PrivilegeArrayData { privilege_count: Vec::new(), privilege_list: Vec::new(), } } }
#[doc = "Reader of register ERR"] pub type R = crate::R<u32, super::ERR>; #[doc = "Reader of field `TEC`"] pub type TEC_R = crate::R<u8, u8>; #[doc = "Reader of field `REC`"] pub type REC_R = crate::R<u8, u8>; #[doc = "Reader of field `RP`"] pub type RP_R = crate::R<bool, bool>; impl R { #[doc = "Bits 0:7 - Transmit Error Counter"] #[inline(always)] pub fn tec(&self) -> TEC_R { TEC_R::new((self.bits & 0xff) as u8) } #[doc = "Bits 8:14 - Receive Error Counter"] #[inline(always)] pub fn rec(&self) -> REC_R { REC_R::new(((self.bits >> 8) & 0x7f) as u8) } #[doc = "Bit 15 - Received Error Passive"] #[inline(always)] pub fn rp(&self) -> RP_R { RP_R::new(((self.bits >> 15) & 0x01) != 0) } }
use crate::intcode_compute::computer_1202; use std::collections::VecDeque; use std::fs; pub fn boost_01() -> VecDeque<i64> { let filename = "./src/aoc09/input.txt"; let contents = fs::read_to_string(filename).expect("Something went wrong reading the file"); let result = computer_1202(&contents, false, &mut VecDeque::from(vec![1])); result.output } pub fn boost_02() -> VecDeque<i64> { let filename = "./src/aoc09/input.txt"; let contents = fs::read_to_string(filename).expect("Something went wrong reading the file"); let result = computer_1202(&contents, false, &mut VecDeque::from(vec![2])); result.output }
use super::*; mod with_atom; #[test] fn without_atom_errors_badarg() { run!( |arc_process| { ( Just(arc_process.clone()), strategy::term::is_not_non_negative_integer(arc_process.clone()), strategy::term(arc_process.clone()), strategy::term(arc_process.clone()), ) }, |(arc_process, time, message, abs_value)| { let options = options(abs_value, &arc_process); let destination = arc_process.pid_term(); prop_assert_is_not_boolean!( result(arc_process.clone(), time, destination, message, options), "abs value", abs_value ); Ok(()) }, ); } fn options(abs: Term, process: &Process) -> Term { process.cons( process.tuple_from_slice(&[Atom::str_to_term("abs"), abs]), Term::NIL, ) }
#[doc = r"Value read from the register"] pub struct R { bits: u32, } #[doc = r"Value to write to the register"] pub struct W { bits: u32, } impl super::FR { #[doc = r"Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); self.register.set(f(&R { bits }, &mut W { bits }).bits); } #[doc = r"Reads the contents of the register"] #[inline(always)] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { self.register.set( f(&mut W { bits: Self::reset_value(), }) .bits, ); } #[doc = r"Reset value of the register"] #[inline(always)] pub const fn reset_value() -> u32 { 0 } #[doc = r"Writes the reset value to the register"] #[inline(always)] pub fn reset(&self) { self.register.set(Self::reset_value()) } } #[doc = r"Value of the field"] pub struct UART_FR_CTSR { bits: bool, } impl UART_FR_CTSR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_CTSW<'a> { w: &'a mut W, } impl<'a> _UART_FR_CTSW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 0); self.w.bits |= ((value as u32) & 1) << 0; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_DSRR { bits: bool, } impl UART_FR_DSRR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_DSRW<'a> { w: &'a mut W, } impl<'a> _UART_FR_DSRW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value as u32) & 1) << 1; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_DCDR { bits: bool, } impl UART_FR_DCDR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_DCDW<'a> { w: &'a mut W, } impl<'a> _UART_FR_DCDW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 2); self.w.bits |= ((value as u32) & 1) << 2; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_BUSYR { bits: bool, } impl UART_FR_BUSYR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_BUSYW<'a> { w: &'a mut W, } impl<'a> _UART_FR_BUSYW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 3); self.w.bits |= ((value as u32) & 1) << 3; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_RXFER { bits: bool, } impl UART_FR_RXFER { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_RXFEW<'a> { w: &'a mut W, } impl<'a> _UART_FR_RXFEW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 4); self.w.bits |= ((value as u32) & 1) << 4; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_TXFFR { bits: bool, } impl UART_FR_TXFFR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_TXFFW<'a> { w: &'a mut W, } impl<'a> _UART_FR_TXFFW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 5); self.w.bits |= ((value as u32) & 1) << 5; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_RXFFR { bits: bool, } impl UART_FR_RXFFR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_RXFFW<'a> { w: &'a mut W, } impl<'a> _UART_FR_RXFFW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 6); self.w.bits |= ((value as u32) & 1) << 6; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_TXFER { bits: bool, } impl UART_FR_TXFER { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_TXFEW<'a> { w: &'a mut W, } impl<'a> _UART_FR_TXFEW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 7); self.w.bits |= ((value as u32) & 1) << 7; self.w } } #[doc = r"Value of the field"] pub struct UART_FR_RIR { bits: bool, } impl UART_FR_RIR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _UART_FR_RIW<'a> { w: &'a mut W, } impl<'a> _UART_FR_RIW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 8); self.w.bits |= ((value as u32) & 1) << 8; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - Clear To Send"] #[inline(always)] pub fn uart_fr_cts(&self) -> UART_FR_CTSR { let bits = ((self.bits >> 0) & 1) != 0; UART_FR_CTSR { bits } } #[doc = "Bit 1 - Data Set Ready"] #[inline(always)] pub fn uart_fr_dsr(&self) -> UART_FR_DSRR { let bits = ((self.bits >> 1) & 1) != 0; UART_FR_DSRR { bits } } #[doc = "Bit 2 - Data Carrier Detect"] #[inline(always)] pub fn uart_fr_dcd(&self) -> UART_FR_DCDR { let bits = ((self.bits >> 2) & 1) != 0; UART_FR_DCDR { bits } } #[doc = "Bit 3 - UART Busy"] #[inline(always)] pub fn uart_fr_busy(&self) -> UART_FR_BUSYR { let bits = ((self.bits >> 3) & 1) != 0; UART_FR_BUSYR { bits } } #[doc = "Bit 4 - UART Receive FIFO Empty"] #[inline(always)] pub fn uart_fr_rxfe(&self) -> UART_FR_RXFER { let bits = ((self.bits >> 4) & 1) != 0; UART_FR_RXFER { bits } } #[doc = "Bit 5 - UART Transmit FIFO Full"] #[inline(always)] pub fn uart_fr_txff(&self) -> UART_FR_TXFFR { let bits = ((self.bits >> 5) & 1) != 0; UART_FR_TXFFR { bits } } #[doc = "Bit 6 - UART Receive FIFO Full"] #[inline(always)] pub fn uart_fr_rxff(&self) -> UART_FR_RXFFR { let bits = ((self.bits >> 6) & 1) != 0; UART_FR_RXFFR { bits } } #[doc = "Bit 7 - UART Transmit FIFO Empty"] #[inline(always)] pub fn uart_fr_txfe(&self) -> UART_FR_TXFER { let bits = ((self.bits >> 7) & 1) != 0; UART_FR_TXFER { bits } } #[doc = "Bit 8 - Ring Indicator"] #[inline(always)] pub fn uart_fr_ri(&self) -> UART_FR_RIR { let bits = ((self.bits >> 8) & 1) != 0; UART_FR_RIR { bits } } } impl W { #[doc = r"Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0 - Clear To Send"] #[inline(always)] pub fn uart_fr_cts(&mut self) -> _UART_FR_CTSW { _UART_FR_CTSW { w: self } } #[doc = "Bit 1 - Data Set Ready"] #[inline(always)] pub fn uart_fr_dsr(&mut self) -> _UART_FR_DSRW { _UART_FR_DSRW { w: self } } #[doc = "Bit 2 - Data Carrier Detect"] #[inline(always)] pub fn uart_fr_dcd(&mut self) -> _UART_FR_DCDW { _UART_FR_DCDW { w: self } } #[doc = "Bit 3 - UART Busy"] #[inline(always)] pub fn uart_fr_busy(&mut self) -> _UART_FR_BUSYW { _UART_FR_BUSYW { w: self } } #[doc = "Bit 4 - UART Receive FIFO Empty"] #[inline(always)] pub fn uart_fr_rxfe(&mut self) -> _UART_FR_RXFEW { _UART_FR_RXFEW { w: self } } #[doc = "Bit 5 - UART Transmit FIFO Full"] #[inline(always)] pub fn uart_fr_txff(&mut self) -> _UART_FR_TXFFW { _UART_FR_TXFFW { w: self } } #[doc = "Bit 6 - UART Receive FIFO Full"] #[inline(always)] pub fn uart_fr_rxff(&mut self) -> _UART_FR_RXFFW { _UART_FR_RXFFW { w: self } } #[doc = "Bit 7 - UART Transmit FIFO Empty"] #[inline(always)] pub fn uart_fr_txfe(&mut self) -> _UART_FR_TXFEW { _UART_FR_TXFEW { w: self } } #[doc = "Bit 8 - Ring Indicator"] #[inline(always)] pub fn uart_fr_ri(&mut self) -> _UART_FR_RIW { _UART_FR_RIW { w: self } } }
use std::path::{Path, PathBuf}; use std::io::{BufRead, BufReader, Read, Write}; use std::process::{Command, Output}; use structopt::StructOpt; use serde::{Deserialize, Serialize}; #[macro_use] extern crate error_chain; mod conan_package; mod err; use crate::conan_package::*; use filesystem::FileSystem; use std::fs::File; use walkdir::{DirEntry, Error}; /* whats next: stream output while invoking commands. handle errors from git. */ fn info(text: &str) { println!("{}", text); } fn warn(text: &str) { println!("{}", text); } fn error(text: &str) { println!("{}", text); } #[derive(StructOpt, Debug)] #[structopt(name = "cracker")] struct Opt { #[structopt(subcommand)] command: CrackerCommand, } #[derive(StructOpt, Debug)] enum CrackerCommand { Install(OptInstall), /// Same as 'install' Conan(OptInstall), Git(OptGit), Import(OptImport), } #[derive(StructOpt, Debug)] struct OptInstall { #[structopt(long, env = "CRACKER_STORAGE_DIR")] prefix: PathBuf, #[structopt(long, env = "CRACKER_STORAGE_BIN")] bin_dir: Option<PathBuf>, reference: String, #[structopt(long)] wrappers: Vec<String>, #[structopt(long, short)] settings: Vec<String>, #[structopt(long, short)] options: Vec<String>, } #[derive(StructOpt, Debug)] struct OptGit { #[structopt(long, env = "CRACKER_STORAGE_DIR")] prefix: PathBuf, #[structopt(long, env = "CRACKER_STORAGE_BIN")] bin_dir: Option<PathBuf>, url: String, #[structopt(long)] wrappers: Vec<String>, #[structopt(long, default_value = ".")] search_paths: Vec<String>, } #[derive(StructOpt, Debug)] struct OptImport { #[structopt(long)] prefix: PathBuf, #[structopt(long)] bin_dir: Option<PathBuf>, db_path: PathBuf, } struct Paths { prefix: PathBuf, bin_dir: PathBuf, install_type: InstallationType, pkg_name: String, } enum InstallationType { Conan, Git, } impl InstallationType { fn format(&self) -> &str { match *self { InstallationType::Conan => "conan", InstallationType::Git => "git", } } } impl Paths { pub fn new( prefix: PathBuf, bin_dir: Option<PathBuf>, install_type: InstallationType, pkg_name: &str, ) -> Self { Self { bin_dir: bin_dir.unwrap_or(prefix.join("bin")), prefix, install_type, pkg_name: pkg_name.to_owned(), } } fn bin_dir(&self) -> PathBuf { self.bin_dir.clone() } fn storage_dir(&self) -> PathBuf { self.prefix.join(".cracker_storage") } fn db_path(&self) -> PathBuf { self.prefix.join(".cracker_index") } fn install_folder(&self) -> PathBuf { //so.. it would be better to actully randomize this - but for now its okayish. //but it doesnt handle at all installing mulple version of the packages. self.storage_dir() .join(format!("{}_{}", self.install_type.format(), self.pkg_name)) } } fn execute(mut c: Command) -> std::io::Result<std::process::Output> { info(&format!("now invoking: {:?}", c)); c.output() } struct ConanStorageGuard<Executor: Fn(Command) -> std::io::Result<std::process::Output>> { executor: Executor, original_storage: String, } impl<Executor: Fn(Command) -> std::io::Result<std::process::Output>> ConanStorageGuard<Executor> { pub fn new(executor: Executor, storage_path: &Path) -> Self { let guard = Self { original_storage: Self::get_storage_path(&executor), executor, }; Self::set_storage_path( &guard.executor, storage_path .as_os_str() .to_str() .expect("Guard::new Path not str?"), ); guard } fn get_storage_path(executor: &Executor) -> String { let mut c = Command::new("conan"); c.args(&["config", "get", "storage.path"]); let output = executor(c).expect(&format!("Unable to extract result of get storage path")); std::str::from_utf8(&output.stdout) .expect(&format!("Borked output from get storage path.")) .to_owned() } fn set_storage_path(executor: &Executor, path: &str) { let mut c = Command::new("conan"); c.args(&["config", "set", &format!("storage.path={}", path)]); let c = executor(c).expect(&format!("Unable to set storage path!")); } } impl<Executor: Fn(Command) -> std::io::Result<std::process::Output>> Drop for ConanStorageGuard<Executor> { fn drop(&mut self) { Self::set_storage_path(&self.executor, &self.original_storage); } } struct Conan<Executor> { executor: Executor, } impl<Executor: Clone + Fn(Command) -> std::io::Result<std::process::Output>> Conan<Executor> { fn new(executor: Executor) -> err::Result<Self> { Ok(Self { executor }) } fn install( &self, conan_pkg: &ConanPackage, paths: &Paths, install_folder: &str, settings: &[String], options: &[String], ) -> err::Result<()> { info(&format!("Installing package: {}", conan_pkg.full())); let guard = ConanStorageGuard::new(self.executor.clone(), &paths.storage_dir().join(".conan")); let settings: Vec<&str> = settings .iter() .flat_map(|s| vec!["-s", s.as_ref()]) .collect(); let options: Vec<&str> = options .iter() .flat_map(|o| vec!["-o", o.as_ref()]) .collect(); let mut c = Command::new("conan"); c.args(&["install", &conan_pkg.full()]) .args(&["-if", install_folder]) .args(&["-g", "virtualrunenv", "-g", "virtualenv"]) .args(&settings) .args(&options); let output = (self.executor)(c)?; if !output.status.success() { Err(err::ErrorKind::ConanInstallFailure(output).into()) } else { Ok(()) } } } fn init_cache<Fs: filesystem::FileSystem>( fs: &Fs, paths: &Paths, ) -> err::Result<(CrackerDatabase)> { //we need to load cache here. let db = if fs.is_file(paths.db_path()) { CrackerDatabase::load(fs, paths.db_path())? } else { fs.create_dir_all(paths.storage_dir())?; CrackerDatabase::new() }; fs.create_dir_all(paths.bin_dir.clone())?; Ok(db) } fn generate_enable_script<Fs: filesystem::FileSystem>(fs: &Fs, paths: &Paths) -> err::Result<()> { let path = paths .bin_dir .parent() .ok_or("Unable to extract parent path")? .join("cracker_enable"); fs.write_file( path, format!( r#" #!/bin/bash export PATH="{}:$PATH" "#, paths.bin_dir.display() ) .trim() .to_owned(), ); Ok(()) } fn input<R: Read>(mut reader: BufReader<R>, message: &'_ impl std::fmt::Display) -> bool { loop { println!("{}", message); let mut ans = String::new(); reader .read_line(&mut ans) .expect("Failed to read from stdin"); let ans = ans.to_lowercase(); let ans = ans.trim(); if ans == "y" || ans == "yes" { return true; } else if ans == "n" || ans == "no" { return false; } else { println!( "only [y|yes|n|no] is accepted as an answer. you gave: {}", ans ) } } } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] struct Wrapper { wrapped_bin: String, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] enum CrackerDatabaseData { Conan { conan_pkg: ConanPackage, conan_settings: Vec<String>, conan_options: Vec<String>, }, Git { pkg_name: String, url: String, label: String, search_paths: Vec<String>, }, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] struct CrackerDatabaseEntry { data: CrackerDatabaseData, wrappers: Vec<Wrapper>, install_folder: String, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] struct CrackerDatabase { wrapped: Vec<CrackerDatabaseEntry>, storage_owned_by: String, } impl CrackerDatabase { fn new() -> Self { CrackerDatabase { wrapped: vec![], storage_owned_by: whoami::username(), } } fn load<Fs: filesystem::FileSystem>(fs: &Fs, path: PathBuf) -> err::Result<Self> { let content = &fs.read_file(path)?; let loaded: Self = serde_json::from_slice(&content)?; if loaded.storage_owned_by != whoami::username() { Err(err::ErrorKind::CrackerStorageDifferentUsername( loaded.storage_owned_by, whoami::username(), ) .into()) } else { Ok(loaded) } } fn save(&self, path: PathBuf) -> err::Result<()> { let mut sanitized = self.clone(); sanitized.wrapped.retain(|e| !e.wrappers.is_empty()); let ser = serde_json::to_string_pretty(&sanitized)?; use std::fs; Ok(File::create(path)?.write_all(ser.as_bytes())?) } fn wrapped(&self, wrapper_name: &str) -> Option<(Wrapper)> { self.wrapped .iter() .find_map(|e| e.wrappers.iter().find(|w| &w.wrapped_bin == wrapper_name)) .cloned() } fn wrappers(&self, install_folder: &str) -> Vec<Wrapper> { self.wrapped .iter() .filter(|e| e.install_folder == install_folder) .map(|e| e.wrappers.clone()) .next() .unwrap_or_default() } fn register_wrap(&mut self, binary: &str, pkg_dir: &str, data: CrackerDatabaseData) { let e_opt = self.wrapped.iter_mut().find(|entry| entry.data == data); let e = if let Some(e) = e_opt { e } else { self.wrapped.push(CrackerDatabaseEntry { data, install_folder: pkg_dir.to_owned(), wrappers: vec![], }); self.wrapped.last_mut().unwrap() }; e.wrappers.push(Wrapper { wrapped_bin: binary.to_owned(), }); } fn unregister_wrapper(&mut self, wrap: &Wrapper) { for e in self.wrapped.iter_mut() { e.wrappers.retain(|w| w != wrap); } } fn unregister_pkg(&mut self, install_folder: &str) { self.wrapped.retain(|f| f.install_folder != install_folder); } } struct CrackRequest { bin: PathBuf, pkg_name: String, data: CrackerDatabaseData, } fn crack<R: Read, Fs: filesystem::FileSystem>( reader: BufReader<R>, fs: &Fs, request: &CrackRequest, paths: &Paths, db: &mut CrackerDatabase, use_conan_wrappers: bool, ) -> std::io::Result<()> { let bin_name = request .bin .file_name() .unwrap() .to_str() .unwrap() .to_owned(); info(&format!("Creating wrapper for: {}", bin_name)); let wrapper_path = paths.bin_dir.join(&bin_name); if let Some(wrapper) = db.wrapped(&bin_name) { if !input( reader, &format!("Wrapper {} already generated overwrite?", bin_name), ) { return Ok(()); } fs.remove_file(&wrapper_path)?; db.unregister_wrapper(&wrapper); } let wrapper_contents = if use_conan_wrappers { format!( r#" #!/bin/bash source {pkg_dir}/activate_run.sh source {pkg_dir}/activate.sh {bin_name} "${{@}}" "#, pkg_dir = paths.install_folder().display(), bin_name = request.bin.display() ) } else { format!( r#" #!/bin/bash {bin_name} "${{@}}" "#, bin_name = request.bin.display() ) }; fs.write_file(&wrapper_path, wrapper_contents.trim().to_owned())?; if let Ok(metadata) = std::fs::metadata(&wrapper_path) { use std::os::unix::fs::PermissionsExt; let mut perms = metadata.permissions(); let exec_all = perms.mode() | 0o111; perms.set_mode(exec_all); std::fs::set_permissions(wrapper_path, perms); } db.register_wrap( &bin_name, paths.install_folder().to_str().unwrap(), request.data.clone(), ); Ok(()) } fn expand_mode_to_all_users(mode: u32) -> u32 { let lit = 0o700 & mode; mode | (lit >> 3) | (lit >> 6) } fn bump_permissions(path: &Path) { use std::os::unix::fs::PermissionsExt; let meta = std::fs::metadata(path).expect(&format!("Unable to get metadata for {}", path.display())); let mut permissions = meta.permissions(); let curr_mode = permissions.mode(); let expanded_mode = expand_mode_to_all_users(curr_mode); if curr_mode != expanded_mode { permissions.set_mode(expanded_mode); std::fs::set_permissions(path, permissions).expect(&format!( "Unable to set permissions for: {}", path.display() )) } } fn extract_path<Fs: filesystem::FileSystem>(fs: &Fs, path: PathBuf) -> Option<String> { let content = fs.read_file(path).ok()?; let content = std::str::from_utf8(&content).ok()?; for line in content.lines() { if line.starts_with("PATH=") { let regex = regex::Regex::new(r#"^PATH="([^"]+)."#).expect("Path deduction regex was invalid."); let captures = regex .captures(line) .expect("Installed binary didnt have proper PATH?"); let path = captures .get(1) .expect("Installed binary didnt have proper PATH?"); return Some(path.as_str().to_owned()); } } None } fn preinstall(paths: Paths) -> err::Result<(Paths, CrackerDatabase)> { let fs = filesystem::OsFileSystem::new(); let db = init_cache(&fs, &paths)?; generate_enable_script(&fs, &paths); Ok((paths, db)) } fn bump_storage_permission(paths: &Paths) -> err::Result<()> { info("now bumping permissions for all the files."); for entry in walkdir::WalkDir::new(paths.storage_dir()) { match entry { Ok(entry) => { let p = entry.path(); bump_permissions(p); } Err(e) => { println!("got error while iterating: {}", e); } } } Ok(()) } fn make_sure_if_empty<Fs: filesystem::FileSystem>( fs: &Fs, pkg_name: &str, paths: &Paths, db: &mut CrackerDatabase, ) -> bool { let if_path = paths.install_folder(); if fs.is_dir(&if_path) { let wrappers = db.wrappers(if_path.to_str().unwrap()); let bins: Vec<String> = wrappers.iter().map(|w| w.wrapped_bin.clone()).collect(); if input(BufReader::new(std::io::stdin().lock()), &format!("Package: {} already installed wraps: [{}], to proceed that package has to be removed, remove?", pkg_name, bins.join(", "))) { if let Err(e) = fs.remove_dir_all(&if_path) { warn(&format!("Failure while removing if: {}, continued. {:?}", if_path.display(), e)); } for bin in bins { if let Err(_) = fs.remove_file(paths.bin_dir().join(&bin)) { warn(&format!("Failure while removing wrapper: {}, continued.", bin)); } } db.unregister_pkg(if_path.to_str().unwrap()); db.save(paths.db_path()); info("ok removed."); return true; } else { return false; } } return true; } fn crackem<Fs: filesystem::FileSystem>( fs: &Fs, paths: &Paths, db: &mut CrackerDatabase, root_path: String, pkg_name: &str, wrappers: &[String], data: CrackerDatabaseData, use_conan_wrappers: bool, ) -> err::Result<()> { for entry in walkdir::WalkDir::new(root_path).max_depth(1) { match entry { Ok(entry) => { if !entry.file_type().is_file() { continue; } let p = entry.path(); use std::os::unix::fs::PermissionsExt; if 0o100 & std::fs::metadata(p) .expect("unable to extract metadata") .permissions() .mode() != 0 { if !wrappers.is_empty() && !wrappers.contains(&p.file_name().unwrap().to_str().unwrap().to_string()) { continue; } crack( BufReader::new(std::io::stdin().lock()), fs, &CrackRequest { pkg_name: pkg_name.to_owned(), bin: std::fs::canonicalize(p.to_path_buf()).unwrap(), data: data.clone(), }, &paths, db, use_conan_wrappers, )?; } } Err(e) => { println!("got error while iterating: {}", e); } } } Ok(()) } fn extract_git_repo_name(url: &str) -> err::Result<String> { let regex = regex::Regex::new(r"^.*/(.*)\.git$").expect("Invalid git regex."); if !regex.is_match(url) { return Err(err::ErrorKind::GitUnableToExtractProjectName(url.to_owned()).into()); } Ok(regex .captures(url) .unwrap() .get(1) .unwrap() .as_str() .to_owned()) } fn do_git_install(i: OptGit) -> err::Result<()> { let fs = filesystem::OsFileSystem::new(); let pkg_name = extract_git_repo_name(&i.url)?; let paths = Paths::new(i.prefix, i.bin_dir, InstallationType::Git, &pkg_name); let (paths, mut db) = preinstall(paths)?; if !make_sure_if_empty(&fs, &pkg_name, &paths, &mut db) { warn("Unable to install package."); return Ok(()); } let mut c = Command::new("git"); c.args(&[ "clone", &i.url, "--depth", "1", paths.install_folder().as_os_str().to_str().unwrap(), ]); execute(c); for path in i.search_paths.iter() { let path = paths .install_folder() .join(path) .to_str() .unwrap() .to_string(); crackem( &fs, &paths, &mut db, path.to_string(), &pkg_name, &i.wrappers, CrackerDatabaseData::Git { pkg_name: pkg_name.clone(), url: i.url.clone(), label: "unimplemented".to_string(), search_paths: i.search_paths.clone(), }, false, )?; } bump_storage_permission(&paths); db.save(paths.db_path()); Ok(()) } fn do_install(i: OptInstall) -> err::Result<()> { let fs = filesystem::OsFileSystem::new(); let conan_pkg = ConanPackage::new(&i.reference)?; let paths = Paths::new( i.prefix, i.bin_dir, InstallationType::Conan, &conan_pkg.name, ); let (paths, mut db) = preinstall(paths)?; let conan = Conan::new(execute)?; let if_path = paths.install_folder(); if !make_sure_if_empty(&fs, &conan_pkg.name, &paths, &mut db) { warn("Unable to install package."); return Ok(()); } let install_folder = if_path .as_os_str() .to_str() .ok_or("unable to generate if folder")?; conan.install(&conan_pkg, &paths, &install_folder, &i.settings, &i.options)?; let env_run_path = if_path.join("environment_run.sh.env"); let path = extract_path(&fs, env_run_path).expect( "environment_run.sh.env did not contain correct PATH? non binary package requested?", ); crackem( &fs, &paths, &mut db, path, &conan_pkg.name, &i.wrappers, CrackerDatabaseData::Conan { conan_pkg: conan_pkg.clone(), conan_settings: i.settings.clone(), conan_options: i.options.clone(), }, true, )?; bump_storage_permission(&paths); db.save(paths.db_path()); Ok(()) } fn do_import(i: OptImport) -> err::Result<()> { let fs = filesystem::OsFileSystem::new(); let db = CrackerDatabase::load(&fs, i.db_path)?; for wrapped in db.wrapped { let wrappers = wrapped .wrappers .iter() .map(|w| w.wrapped_bin.clone()) .collect(); match wrapped.data { CrackerDatabaseData::Conan { conan_pkg, conan_options, conan_settings, } => { info(&format!("now installing: {}", conan_pkg.full())); let install = OptInstall { prefix: i.prefix.clone(), bin_dir: i.bin_dir.clone(), options: conan_options, settings: conan_settings, wrappers, reference: conan_pkg.full(), }; do_install(install)?; } CrackerDatabaseData::Git { pkg_name, url, label, search_paths, } => { info(&format!("now installing: {}", url)); let install = OptGit { url, search_paths, wrappers, prefix: i.prefix.clone(), bin_dir: i.bin_dir.clone(), }; do_git_install(install)?; } } } Ok(()) } fn main() { let opt: Opt = Opt::from_args(); println!("{:#?}", opt); match opt.command { CrackerCommand::Install(i) | CrackerCommand::Conan(i) => { if let Err(e) = do_install(i) { match e.0 { err::ErrorKind::Io(_) => { panic!("io error: {}", e.0); } err::ErrorKind::SerdeJson(_) => { panic!("Serde Json Error: {}", e.0); } err::ErrorKind::Msg(_) => {} err::ErrorKind::ConanNotInPath => { println!("{}", e); } err::ErrorKind::CrackerStorageDifferentUsername(_, _) => { println!("{}", e); } err::ErrorKind::ConanInstallFailure(_) => { println!("{}", e); } err::ErrorKind::__Nonexhaustive {} => {} err::ErrorKind::GitUnableToExtractProjectName(_) => { println!("{}", e); } } } } CrackerCommand::Import(i) => { do_import(i); } CrackerCommand::Git(i) => { do_git_install(i); } } } #[cfg(test)] mod package_tests { use crate::conan_package::ConanPackage; use crate::{ crack, err, expand_mode_to_all_users, extract_git_repo_name, extract_path, generate_enable_script, init_cache, Conan, CrackRequest, CrackerDatabase, CrackerDatabaseData, CrackerDatabaseEntry, InstallationType, Paths, Wrapper, }; use std::collections::BTreeMap; use std::io::BufReader; use std::path::PathBuf; use std::process::Command; fn assert_command_generate_output( c: Command, sender: std::sync::mpsc::Sender<String>, stdout: &str, ) -> std::io::Result<std::process::Output> { let invocation = format!("{:?}", c); sender.send(invocation); use std::os::unix::process::ExitStatusExt; use std::process::{ExitStatus, Output}; Ok(Output { status: ExitStatus::from_raw(0i32), stderr: Vec::new(), stdout: stdout.as_bytes().to_vec(), }) } #[test] fn init_cache_dir_test() { let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; let fs = filesystem::MockFileSystem::new(); fs.is_file.return_value(false); let db = init_cache(&fs, &paths).unwrap(); assert_eq!( fs.create_dir_all.calls(), vec![ PathBuf::from("some/random/path/.cracker_storage"), PathBuf::from("some/random/path/bin"), ] ); assert!(!db.storage_owned_by.is_empty()) } #[test] fn init_cache_dir_db_already_exists() { let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; let fs = filesystem::MockFileSystem::new(); fs.is_file.return_value(true); let username = whoami::username(); fs.read_file.return_value(Ok(String::from(format!( r#"{{"wrapped":[],"storage_owned_by":"{}"}}"#, username )) .as_bytes() .to_vec())); let db = init_cache(&fs, &paths).unwrap(); assert_eq!( fs.create_dir_all.calls(), vec![PathBuf::from("some/random/path/bin"),] ); assert!(!db.storage_owned_by.is_empty()); } #[test] fn init_cache_dir_db_already_exists_diff_username() { let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; let fs = filesystem::MockFileSystem::new(); fs.is_file.return_value(true); let username = whoami::username(); fs.read_file.return_value(Ok(String::from( r#"{"wrapped":[],"storage_owned_by":"not_me"}"#, ) .as_bytes() .to_vec())); let result = init_cache(&fs, &paths); let display = format!("{}", result.err().unwrap()); assert_eq!( display, r#"Cracker storage owned by: 'not_me' while you are: 'fulara'"# ); assert!(fs.create_dir_all.calls().is_empty()); } #[test] fn crack_tests() { let req = CrackRequest { bin: PathBuf::from("binary"), pkg_name: String::from("abc"), data: CrackerDatabaseData::Conan { conan_pkg: ConanPackage::new("abc/321@a/b").unwrap(), conan_settings: vec![], conan_options: vec![], }, }; let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; let fs = filesystem::MockFileSystem::new(); let mut db = CrackerDatabase { wrapped: vec![], storage_owned_by: String::new(), }; assert!(db .wrapped(req.bin.file_name().unwrap().to_str().unwrap()) .is_none()); let result = crack( BufReader::new("".as_bytes()), &fs, &req, &paths, &mut db, true, ); assert_eq!( db.wrapped(req.bin.file_name().unwrap().to_str().unwrap()), Some(Wrapper { wrapped_bin: String::from("binary") }) ); let f = &fs.write_file.calls()[0]; assert_eq!(f.0, PathBuf::from("some/random/path/bin/binary")); assert_eq!( std::str::from_utf8(&f.1).unwrap(), r#"#!/bin/bash source some/random/path/.cracker_storage/conan_abc/activate_run.sh source some/random/path/.cracker_storage/conan_abc/activate.sh binary "${@}""# ); let fs = filesystem::MockFileSystem::new(); let result = crack( BufReader::new("y".as_bytes()), &fs, &req, &paths, &mut db, true, ); assert_eq!( fs.remove_file.calls()[0], PathBuf::from("some/random/path/bin/binary") ); let f = &fs.write_file.calls()[0]; assert_eq!(f.0, PathBuf::from("some/random/path/bin/binary")); assert_eq!( std::str::from_utf8(&f.1).unwrap(), r#"#!/bin/bash source some/random/path/.cracker_storage/conan_abc/activate_run.sh source some/random/path/.cracker_storage/conan_abc/activate.sh binary "${@}""# ); // binary wrapped already - user does not want to override. let fs = filesystem::MockFileSystem::new(); crack( BufReader::new("n".as_bytes()), &fs, &req, &paths, &mut db, true, ) .unwrap(); assert!(fs.remove_file.calls().is_empty()); assert!(fs.write_file.calls().is_empty()); } #[test] fn conan_install_fun() { let mut expected_invocations = vec![ String::from(r#""conan" "config" "get" "storage.path""#), String::from( r#""conan" "config" "set" "storage.path=some/random/path/.cracker_storage""#, ), String::from( r#""conan" "install" "abc/321@" "-if" "some_folder" "-g" "virtualrunenv" "-g" "virtualenv" "-s" "some_set" "-s" "another_one" "-o" "opt""#, ), String::from(r#""conan" "config" "set" "storage.path=abc""#), ]; let (sender, receiver) = std::sync::mpsc::channel(); let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; Conan::new(|c| assert_command_generate_output(c, sender.clone(), "abc")) .unwrap() .install( &ConanPackage::new("abc/321@").unwrap(), &paths, "some_folder", &vec![String::from("some_set"), String::from("another_one")], &vec![String::from("opt")], ); let captured_invocations: Vec<String> = receiver.try_iter().collect(); assert_eq!(captured_invocations, expected_invocations); } #[test] fn permissions() { let paths = Paths { prefix: PathBuf::from("some/random/path"), bin_dir: PathBuf::from("some/random/path/bin"), install_type: InstallationType::Conan, pkg_name: "abc".to_owned(), }; let mut fs = filesystem::MockFileSystem::new(); generate_enable_script(&mut fs, &paths).unwrap(); let call = &fs.write_file.calls()[0]; assert_eq!(call.0, PathBuf::from("some/random/path/cracker_enable")); assert_eq!( std::str::from_utf8(&call.1).unwrap(), r#"#!/bin/bash export PATH="some/random/path/bin:$PATH""# ) // let f = std::fs::Permissions:: } #[test] fn extract_test_path() { let mut fs = filesystem::MockFileSystem::new(); fs.read_file.return_value(Ok(String::from( r#" abcabcabc PATH="wole":"abc" "#, ) .into_bytes())); assert_eq!( extract_path(&fs, PathBuf::new()), Some(String::from("wole")) ); } #[test] fn expand_mode_to_all_users_test() { assert_eq!(expand_mode_to_all_users(0o100u32), 0o111); assert_eq!(expand_mode_to_all_users(0o300u32), 0o333); assert_eq!(expand_mode_to_all_users(0o644u32), 0o666); assert_eq!(expand_mode_to_all_users(0o713u32), 0o777); assert_eq!(expand_mode_to_all_users(0o134u32), 0o135); } #[test] fn extract_git_url_project_name() { assert_eq!( extract_git_repo_name("https://github.com/fulara/conan-cracker.git").unwrap(), String::from("conan-cracker") ); } }
pub mod primitives; pub mod widgets;
use crate::util::{self, color}; use crate::{cmd::edit, config, err}; use anyhow::Result; use std::collections::HashMap; use std::env; use std::fs::File; use std::process::Command; pub fn remove() -> Result<()> { use std::io::prelude::*; let machine_id = util::machine_id()?; let mut temp_dests_path = env::temp_dir(); temp_dests_path.push(format!("remove-{}", machine_id)); let config = config::get_config()?; let old_dests = config.dests(); let mut temp_dests_file = File::create(&temp_dests_path)?; temp_dests_file .write_all(&serde_json::to_string_pretty(&config.dests())?.as_bytes())?; temp_dests_file.flush()?; Command::new(edit::editor()?) .arg(&temp_dests_path) .status()?; let mut remaining_dests = String::new(); File::open(temp_dests_path)?.read_to_string(&mut remaining_dests)?; let remaining_dests: HashMap<String, String> = serde_json::from_str(&remaining_dests)?; for (key, _) in remaining_dests.iter() { if !old_dests.contains_key(key) { return err::err(format!( "Found new key '{}' while removing, use '{}' to add an entry instead.", color::emphasis(key), color::emphasis("tittle track"), )); } } let mut removed_keys = Vec::new(); for (key, _) in old_dests.iter() { if !remaining_dests.contains_key(key) { removed_keys.push(key); util::info(format!("Removing entry '{}'", color::emphasis(key))); } } // remove these keys from default and override dest/templates. Ok(()) }
use std::error::Error; use std::ops::Deref; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use meilisearch_core::{Database, DatabaseOptions, Index}; use sha2::Digest; use crate::error::{Error as MSError, ResponseError}; use crate::index_update_callback; use crate::option::Opt; use crate::dump::DumpInfo; #[derive(Clone)] pub struct Data { inner: Arc<DataInner>, } impl Deref for Data { type Target = DataInner; fn deref(&self) -> &Self::Target { &self.inner } } #[derive(Clone)] pub struct DataInner { pub db: Arc<Database>, pub db_path: String, pub dumps_dir: PathBuf, pub dump_batch_size: usize, pub api_keys: ApiKeys, pub server_pid: u32, pub http_payload_size_limit: usize, pub current_dump: Arc<Mutex<Option<DumpInfo>>>, } #[derive(Clone)] pub struct ApiKeys { pub public: Option<String>, pub private: Option<String>, pub master: Option<String>, } impl ApiKeys { pub fn generate_missing_api_keys(&mut self) { if let Some(master_key) = &self.master { if self.private.is_none() { let key = format!("{}-private", master_key); let sha = sha2::Sha256::digest(key.as_bytes()); self.private = Some(format!("{:x}", sha)); } if self.public.is_none() { let key = format!("{}-public", master_key); let sha = sha2::Sha256::digest(key.as_bytes()); self.public = Some(format!("{:x}", sha)); } } } } impl Data { pub fn new(opt: Opt) -> Result<Data, Box<dyn Error>> { let db_path = opt.db_path.clone(); let dumps_dir = opt.dumps_dir.clone(); let dump_batch_size = opt.dump_batch_size; let server_pid = std::process::id(); let db_opt = DatabaseOptions { main_map_size: opt.max_mdb_size, update_map_size: opt.max_udb_size, }; let http_payload_size_limit = opt.http_payload_size_limit; let db = Arc::new(Database::open_or_create(opt.db_path, db_opt)?); let mut api_keys = ApiKeys { master: opt.master_key, private: None, public: None, }; api_keys.generate_missing_api_keys(); let current_dump = Arc::new(Mutex::new(None)); let inner_data = DataInner { db: db.clone(), db_path, dumps_dir, dump_batch_size, api_keys, server_pid, http_payload_size_limit, current_dump, }; let data = Data { inner: Arc::new(inner_data), }; let callback_context = data.clone(); db.set_update_callback(Box::new(move |index_uid, status| { index_update_callback(&index_uid, &callback_context, status); })); Ok(data) } fn create_index(&self, uid: &str) -> Result<Index, ResponseError> { if !uid .chars() .all(|x| x.is_ascii_alphanumeric() || x == '-' || x == '_') { return Err(MSError::InvalidIndexUid.into()); } let created_index = self.db.create_index(&uid).map_err(|e| match e { meilisearch_core::Error::IndexAlreadyExists => e.into(), _ => ResponseError::from(MSError::create_index(e)), })?; self.db.main_write::<_, _, ResponseError>(|mut writer| { created_index.main.put_name(&mut writer, uid)?; created_index .main .created_at(&writer)? .ok_or(MSError::internal("Impossible to read created at"))?; created_index .main .updated_at(&writer)? .ok_or(MSError::internal("Impossible to read updated at"))?; Ok(()) })?; Ok(created_index) } pub fn get_current_dump_info(&self) -> Option<DumpInfo> { self.current_dump.lock().unwrap().clone() } pub fn set_current_dump_info(&self, dump_info: DumpInfo) { self.current_dump.lock().unwrap().replace(dump_info); } pub fn get_or_create_index<F, R>(&self, uid: &str, f: F) -> Result<R, ResponseError> where F: FnOnce(&Index) -> Result<R, ResponseError>, { let mut index_has_been_created = false; let index = match self.db.open_index(&uid) { Some(index) => index, None => { index_has_been_created = true; self.create_index(&uid)? } }; match f(&index) { Ok(r) => Ok(r), Err(err) => { if index_has_been_created { let _ = self.db.delete_index(&uid); } Err(err) } } } }
extern crate gl; extern crate sdl2; extern crate log; use super::std::mem; use self::sdl2::video; use self::sdl2::video::GLAttr; pub enum GLVersion { Core((i32, i32)), } pub struct WindowOptions { pub gl_version: GLVersion, pub title: String, pub initial_size: (i32, i32), } pub struct Window { sdl_context: self::sdl2::sdl::Sdl, sdl_window: self::sdl2::video::Window, _sdl_gl_context: self::sdl2::video::GLContext, pub size: (i32, i32), } impl Window { pub fn new(options: WindowOptions) -> Window { let sdl_context = sdl2::init(sdl2::INIT_VIDEO).unwrap(); match options.gl_version { GLVersion::Core((major, minor)) => { video::gl_set_attribute(GLAttr::GLContextProfileMask, video::GLProfile::GLCoreProfile as i32); video::gl_set_attribute(GLAttr::GLContextMajorVersion, major); video::gl_set_attribute(GLAttr::GLContextMinorVersion, minor); } } video::gl_set_attribute(GLAttr::GLAcceleratedVisual, 1); video::gl_set_attribute(GLAttr::GLDoubleBuffer, 1); let (window_width, window_height) = options.initial_size; let window = match video::Window::new( &options.title, video::WindowPos::PosCentered, video::WindowPos::PosCentered, window_width, window_height, video::RESIZABLE | video::OPENGL ) { Ok(window) => window, Err(err) => panic!("failed to create window: {}", err), }; window.set_bordered(true); let gl_context = match window.gl_create_context() { Err(err) => panic!("failed to create GL context: {}", err), Ok(gl_context) => { gl::load_with(|s| unsafe { mem::transmute(sdl2::video::gl_get_proc_address(s)) }); gl_context }, }; Window { sdl_context: sdl_context, sdl_window: window, _sdl_gl_context: gl_context, size: options.initial_size, } } pub fn run<F: FnMut()>(&mut self, mut render: F) { let mut event_pump = self.sdl_context.event_pump(); let mut is_closed = false; while !is_closed { for event in event_pump.poll_iter() { use self::sdl2::event::Event; use self::sdl2::event::WindowEventId; match event { Event::Quit {..} => { is_closed = true; }, Event::Window { win_event_id: WindowEventId::Resized, data1: w, data2: h, .. } => { self.size = (w, h); }, _ => () } } render(); self.sdl_window.gl_swap_window(); } } }
#![allow(dead_code)] //! Architecture //! ============ //! //! Game Loop //! --------- //! //! +---> P ---> A ---> I ---> U ---+ //! | | //! ^ GAME LOOP v //! | | //! +---------| running? |----------+ //! //! * `Present` the scene to the user //! * `Accept` input from the user. //! * `Interpret` the input of the user and determine what should happen //! and determines the next scene //! * `Update` the game state based on the interpretation //! //! States //! ------ //! The game will present different scenes to the player: //! //! * Main menu //! * Game world //! * Level up screen //! * Reward / path selection screen //! //! States are pushed onto the `StateStack` based on the results //! of interpreting the player input. When a scene exits, it is popped //! off the stack. A scene can also push another scene onto the stack, //! which would then need to exit, before returning back to the original //! scene. //! //! |> Main Menu ! START //! => Main Menu -> Game World ! ATTACK //! => Main Menu -> Game World ! LEVEL UP //! => Main Menu -> Game World -> Level Up ! EXIT //! => Main Menu -> Game World ! MOVE //! => Main Menu -> Game World ! NEXT LEVEL //! => Main Menu -> Game World -> Choose Path ! OPEN INVENTORY //! => Main Menu -> Game World -> Choose Path -> Inventory ! EXIT //! => Main Menu -> Game World -> Choose Path -> ! EXIT //! => Main Menu -> Game World ! MOVE //! => Main Menu -> Game World ! EXIT //! => Main Menu ! EXIT //! <| OS pub use rostlaube::colors::{self, Color}; pub use rostlaube::console::{BackgroundFlag, Console, Offscreen, TextAlignment}; pub use rostlaube::geometry::{Dimension, Direction, Location}; pub use rostlaube::input::{self, Key, KeyCode}; pub use rostlaube::map::{self, FovAlgorithm, Map as FovMap}; pub use rostlaube::rng; pub use rostlaube::ui; pub use rostlaube::{Event, State, Transition}; // Internal pub mod ai; pub mod dungeon; pub mod engine; pub mod game; mod scenes; use crate::game::Game; use scenes::GameSettings; /// Width of the game screen in number of tiles const SCREEN_WIDTH: i32 = 1920 / 10 / 2; /// Height of the game screen in number of tiles const SCREEN_HEIGHT: i32 = SCREEN_WIDTH / 16 * 9; /// Frame rate limit const LIMIT_FPS: i32 = 60; /// Width of the map const MAP_WIDTH: i32 = 80; /// Height of the map const MAP_HEIGHT: i32 = 43; /// Maximum width/height of a room const ROOM_MAX_SIZE: i32 = 10; /// Minimux width/height of a room const ROOM_MIN_SIZE: i32 = 6; /// Maximum number of rooms const MAX_ROOMS: i32 = 30; /// Maximum number of monsters per room const MAX_ROOM_MONSTERS: i32 = 3; /// Maximum number of items per room const MAX_ROOM_ITEMS: i32 = 2; /// Index of player in vector of objects const PLAYER: usize = 0; // The player will always be the first object /// Main entry point pub fn run() { let mut engine = rostlaube::Engine::new(SCREEN_WIDTH, SCREEN_HEIGHT, LIMIT_FPS); engine .run(Default::default(), scenes::main_menu()) .and_then(|settings| match settings { GameSettings::NewGame { player_name } => Some(Game::new( &player_name, Dimension(MAP_WIDTH, MAP_HEIGHT), Dimension(ROOM_MIN_SIZE, ROOM_MAX_SIZE), MAX_ROOMS, MAX_ROOM_MONSTERS, MAX_ROOM_ITEMS, )), GameSettings::LoadGame { path } => { println!("Load game from: {:?}", path); None } }) .map(|game| engine.run(game, scenes::game_world())) .map(|game| { println!("Final game state:"); println!("{:?}", game); }); engine.exit(); }
use env::*; use objects::*; fn init_port(env: &mut SchemeEnv) { env.add_global("call-with-input-file", &SchemeObject::new_prim()); env.add_global("call-with-output-file", &SchemeObject::new_prim()); env.add_global("input-port?", &SchemeObject::new_prim()); env.add_global("output-port?", &SchemeObject::new_prim()); env.add_global("current-input-port", &SchemeObject::new_prim()); env.add_global("current-output-port", &SchemeObject::new_prim()); env.add_global("with-input-from-file", &SchemeObject::new_prim()); env.add_global("with-input-from-string", &SchemeObject::new_prim()); env.add_global("with-output-to-file", &SchemeObject::new_prim()); env.add_global("open-input-file", &SchemeObject::new_prim()); env.add_global("open-input-string", &SchemeObject::new_prim()); env.add_global("open-output-file", &SchemeObject::new_prim()); env.add_global("close-input-port", &SchemeObject::new_prim()); env.add_global("close-output-port", &SchemeObject::new_prim()); env.add_global("read", &SchemeObject::new_prim()); env.add_global("read-char", &SchemeObject::new_prim()); env.add_global("peek-char", &SchemeObject::new_prim()); env.add_global("eof-object?", &SchemeObject::new_prim()); env.add_global("char-ready?", &SchemeObject::new_prim()); env.add_global("write", &SchemeObject::new_prim()); env.add_global("display", &SchemeObject::new_prim()); env.add_global("newline", &SchemeObject::new_prim()); env.add_global("write-char", &SchemeObject::new_prim()); env.add_global("load", &SchemeObject::new_prim()); env.add_global("flush-output", &SchemeObject::new_prim()); env.add_global("write-to-string", &SchemeObject::new_prim()); env.add_global("display-to-string", &SchemeObject::new_prim()); }
use byteorder::{BigEndian, ByteOrder}; use bytes::{Buf, BufMut, BytesMut}; use futures::SinkExt; use prost::Message; use std::{error::Error, fmt, fs, io, usize}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::UnixListener; use tokio::signal; use tokio_stream::StreamExt; use tokio_util::codec::{Decoder, Encoder, Framed}; pub struct Protocol; impl Protocol { fn new() -> Self { Protocol } } impl Decoder for Protocol { type Item = Vec<u8>; type Error = io::Error; fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<Vec<u8>>> { // println!("buf_len:{:?} is_empty:{}", buf.len(), buf.is_empty()); if buf.is_empty() { return Ok(None); } if buf.len() > 4 { let proto_len_buf = &buf[0..4]; let body_len = BigEndian::read_uint(&proto_len_buf.to_vec(), 4); if buf.len() < body_len as usize { return Ok(None); } let body = buf.split_to((body_len + 4) as usize); Ok(Some(body[4..].to_vec())) } else { Ok(None) } } fn decode_eof(&mut self, buf: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> { match self.decode(buf)? { Some(frame) => Ok(Some(frame)), None => { if buf.is_empty() { Ok(None) } else { Err(io::Error::new( io::ErrorKind::Other, "bytes remaining on stream", )) } } } } fn framed<T: tokio::io::AsyncRead + tokio::io::AsyncWrite + Sized>( self, io: T, ) -> Framed<T, Self> where Self: Sized, { Framed::new(io, self) } } impl Encoder<Vec<u8>> for Protocol { type Error = io::Error; fn encode(&mut self, item: Vec<u8>, dst: &mut BytesMut) -> io::Result<()> { // println!("{:?}", item); dst.put(&item[..]); Ok(()) } }
#[macro_use] extern crate cpython; use cpython::{PyResult, Python}; py_module_initializer!(libtfidf, initlibtfidf, PyInit_libtfidf, |py, m| { m.add(py, "__doc__", "tf-idf")?; m.add(py, "tfidf", py_fn!(py, tfidf_py(docs: Vec<Vec<usize>>)))?; m.add(py, "tf", py_fn!(py, tf_py(docs: Vec<Vec<usize>>)))?; Ok(()) }); type SparseMatrix = (usize, usize, Vec<(usize, usize, f32)>); fn tfidf(docs: &Vec<Vec<usize>>) -> SparseMatrix { use std::collections::{HashSet, HashMap}; let docsize = docs.len(); let vocsize = docs.iter().map(|d| d.iter().max().unwrap_or(&0)).max().unwrap_or(&0) + 1; let mut idf = vec![0.0f32; vocsize]; // document freq for d in docs.iter() { let ws: HashSet<&usize> = d.iter().collect(); for &w in ws.iter() { idf[*w] += 1.0; } } // inverse df for i in 0..vocsize { if idf[i] > 0.0 { idf[i] = (docsize as f32 / idf[i]).ln() } } let mut tfidf = vec![]; // * tf for i in 0..docsize { let mut ws = HashMap::new(); for &w in docs[i].iter() { let count = ws.entry(w).or_insert(0); *count += 1; } for (&w, &count) in ws.iter() { if idf[w] == 0.0 || count == 0 { continue } tfidf.push((i, w, idf[w] * count as f32)); } } (docsize, vocsize, tfidf) } fn tfidf_py(_: Python, docs: Vec<Vec<usize>>) -> PyResult<SparseMatrix> { let out = tfidf(&docs); Ok(out) } fn tf(docs: &Vec<Vec<usize>>) -> SparseMatrix { use std::collections::HashMap; let docsize = docs.len(); let vocsize = docs.iter().map(|d| d.iter().max().unwrap_or(&0)).max().unwrap_or(&0) + 1; let mut tf = vec![]; // * tf for i in 0..docsize { let mut ws = HashMap::new(); for &w in docs[i].iter() { let count = ws.entry(w).or_insert(0); *count += 1; } for (&w, &count) in ws.iter() { if count == 0 { continue } tf.push((i, w, count as f32)); } } (docsize, vocsize, tf) } fn tf_py(_: Python, docs: Vec<Vec<usize>>) -> PyResult<SparseMatrix> { let out = tf(&docs); Ok(out) }
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use alloc::string::String; use alloc::string::ToString; use alloc::sync::Arc; use spin::RwLock; use spin::Mutex; use alloc::vec::Vec; use super::super::qlib::common::*; use super::super::qlib::path::*; use super::super::task::*; use super::super::qlib::linux_def::*; use super::super::qlib::auth::*; use super::super::kernel::time::*; use super::super::socket::unix::transport::unix::*; use super::inode::*; use super::overlay::*; use super::dirent::*; use super::copy_up::*; use super::file::*; use super::flags::*; use super::attr::*; use super::file_overlay::*; use super::mount::*; pub fn OverlayHasWhiteout(parent: &Inode, name: &str) -> bool { match parent.Getxattr(&XattrOverlayWhiteout(name)) { Ok(s) => return s.as_str() == "y", _ => return false, } } pub fn overlayCreateWhiteout(parent: &mut Inode, name: &str) -> Result<()> { return parent.Setxattr(&XattrOverlayWhiteout(name), &"y".to_string()) } pub fn overlayLookup(task: &Task, parent: &Arc<RwLock<OverlayEntry>>, inode: &Inode, name: &str) -> Result<(Dirent, bool)> { let parent = parent.read(); if parent.upper.is_none() && parent.lower.is_none() { panic!("invalid overlayEntry, needs at least one Inode") } let mut upperInode: Option<Inode> = None; let mut lowerInode: Option<Inode> = None; if parent.upper.is_some() { let upper = parent.upper.as_ref().unwrap().clone(); match upper.Lookup(task, name) { Ok(child) => { upperInode = Some(child.Inode()); } Err(Error::SysError(SysErr::ENOENT)) => { upperInode = None; } Err(e) => return Err(e) } if OverlayHasWhiteout(&upper, name) { if upperInode.is_none() { return Err(Error::SysError(SysErr::ENOENT)) } let entry = OverlayEntry::New(task, upperInode, None, false)?; let oinode = NewOverlayInode(task, entry, &inode.lock().MountSource); let d = Dirent::New(&oinode, name); return Ok((d, true)) } } if parent.lower.is_some() { let lower = parent.lower.as_ref().unwrap().clone(); match lower.Lookup(task, name) { Ok(child) => { if upperInode.is_none() { lowerInode = Some(child.Inode()); } else { let childInode = child.Inode(); if upperInode.as_ref().unwrap().StableAttr().Type == childInode.StableAttr().Type || upperInode.as_ref().unwrap().StableAttr().IsDir() && childInode.StableAttr().IsDir() { lowerInode = Some(child.Inode()); } } } Err(Error::SysError(SysErr::ENOENT)) => { lowerInode = None; } Err(e) => return Err(e) } } if upperInode.is_none() && lowerInode.is_none() { return Err(Error::SysError(SysErr::ENOENT)) } let lowerExists = lowerInode.is_some(); if upperInode.is_some() && lowerInode.is_some() { upperInode.as_ref().unwrap().lock().StableAttr = lowerInode.as_ref().unwrap().lock().StableAttr; if upperInode.as_ref().unwrap().StableAttr().IsDir() { lowerInode = None; } } let upperIsSome = upperInode.is_some(); let entry = OverlayEntry::New(task, upperInode, lowerInode, lowerExists)?; let oinode = NewOverlayInode(task, entry, &inode.lock().MountSource); let d = Dirent::New(&oinode, name); return Ok((d, upperIsSome)) } pub fn OverlayCreate(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, name: &str, flags: &FileFlags, perm: &FilePermissions) -> Result<File> { CopyUpLockedForRename(task, parent)?; let mut upper = o.read().upper.as_ref().unwrap().clone(); let upperInodeOp = upper.lock().InodeOp.clone(); let upperFile = upperInodeOp.Create(task, &mut upper, name, flags, perm)?; let upperFileInode = upperFile.Dirent.Inode(); let entry = match OverlayEntry::New(task, Some(upperFileInode.clone()), None, false) { Ok(e) => e, Err(e) => { cleanupUpper(task, &mut upper, name); return Err(e); } }; //let mut upperDirent = Dirent::NewTransient(&upperFileInode); (*(upperFile.Dirent.0).0.lock()).Inode = upperFileInode; (*(upperFile.Dirent.0).0.lock()).Parent = None; let parentInode = parent.Inode(); let overlayInode = NewOverlayInode(task, entry, &parentInode.lock().MountSource); let overlayDirent = Dirent::New(&overlayInode, name); let mut oFlags = *flags; oFlags.Pread = upperFile.Flags().Pread; oFlags.PWrite = upperFile.Flags().PWrite; let overlayFile = File::New(&overlayDirent, &oFlags, OverlayFileOperations { upper: Mutex::new(Some(upperFile)), ..Default::default() }); return Ok(overlayFile) } pub fn overlayCreateDirectory(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, name: &str, perm: &FilePermissions) -> Result<()> { CopyUpLockedForRename(task, parent)?; let mut inode = o.read().upper.as_ref().unwrap().clone(); let iops = inode.lock().InodeOp.clone(); let res = iops.CreateDirectory(task, &mut inode, name, perm); return res; } pub fn overlayCreateLink(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, oldname: &str, newname: &str) -> Result<()> { CopyUpLockedForRename(task, parent)?; let mut inode = o.read().upper.as_ref().unwrap().clone(); let iops = inode.lock().InodeOp.clone(); let res = iops.CreateLink(task, &mut inode, oldname, newname); return res; } pub fn overlayCreateHardLink(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, target: &Dirent, name: &str) -> Result<()> { CopyUpLockedForRename(task, parent)?; CopyUpLockedForRename(task, target)?; let mut inode = o.read().upper.as_ref().unwrap().clone(); let iops = inode.lock().InodeOp.clone(); let tmpInode = target.Inode(); let targetInode = tmpInode.lock().Overlay.as_ref().unwrap().read().upper.as_ref().unwrap().clone(); let res = iops.CreateHardLink(task, &mut inode, &targetInode, name); return res; } pub fn overlayCreateFifo(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, name: &str, perm: &FilePermissions) -> Result<()> { CopyUpLockedForRename(task, parent)?; let mut inode = o.read().upper.as_ref().unwrap().clone(); let iops = inode.lock().InodeOp.clone(); let res = iops.CreateFifo(task, &mut inode, name, perm); return res; } pub fn overlayRemove(task: &Task, o: &Arc<RwLock<OverlayEntry>>, parent: &Dirent, child: &Dirent) -> Result<()> { CopyUpLockedForRename(task, parent)?; let childinode = child.Inode(); let overlay = childinode.lock().Overlay.as_ref().unwrap().clone(); let overlaylock = overlay.read(); if overlaylock.upper.is_some() { let mut oupper = o.read().upper.as_ref().unwrap().clone(); let oupperOps = oupper.lock().InodeOp.clone(); if childinode.StableAttr().Type == InodeType::Directory { oupperOps.RemoveDirectory(task, &mut oupper, &(child.0).0.lock().Name)? } else { oupperOps.Remove(task, &mut oupper, &(child.0).0.lock().Name)? } } if overlaylock.LowerExists { let mut oupper = o.read().upper.as_ref().unwrap().clone(); return overlayCreateWhiteout(&mut oupper, &(child.0).0.lock().Name) } return Ok(()) } pub fn overlayRename(task: &Task, o: &Arc<RwLock<OverlayEntry>>, oldParent: &Dirent, renamed: &Dirent, newParent: &Dirent, newName: &str, replacement: bool) -> Result<()> { let renamedInode = renamed.Inode(); let oldParentInode = oldParent.Inode(); let newParentInode = newParent.Inode(); if renamedInode.lock().Overlay.is_none() || oldParentInode.lock().Overlay.is_none() || newParentInode.lock().Overlay.is_none() { return Err(Error::SysError(SysErr::EXDEV)) } let mut replacement = replacement; if replacement { let newParentInode = newParent.Inode(); let newParentOverlay = newParentInode.lock().Overlay.as_ref().unwrap().clone(); match overlayLookup(task, &newParentOverlay, &newParentInode, newName) { Ok((replaced, inUpper)) => { if !inUpper { replacement = false; } let replacedInode = replaced.Inode(); let isDir = replacedInode.StableAttr().IsDir(); if isDir { let children = ReaddirOne(task, &replaced)?; if children.len() > 0 { return Err(Error::SysError(SysErr::ENOTEMPTY)) } } } Err(Error::SysError(SysErr::ENOENT)) => (), Err(e) => { return Err(e) } } } CopyUpLockedForRename(task, renamed)?; CopyUpLockedForRename(task, newParent)?; let oldName = (renamed.0).0.lock().Name.to_string(); let overlayUpper = o.read().upper.as_ref().unwrap().clone(); let overlayUpperOps = overlayUpper.lock().InodeOp.clone(); let renamedInode = renamed.Inode(); let mut renamedUpper = renamedInode.lock().Overlay.as_ref().unwrap().read().upper.as_ref().unwrap().clone(); let oldParentInode = oldParent.Inode(); let mut oldParentUpper = oldParentInode.lock().Overlay.as_ref().unwrap().read().upper.as_ref().unwrap().clone(); let newParentUpper = newParent.Inode().lock().Overlay.as_ref().unwrap().read().upper.as_ref().unwrap().clone(); overlayUpperOps.Rename(task, &mut renamedUpper, &oldParentUpper, &oldName, &newParentUpper, newName, replacement)?; let lowerExists = renamedInode.lock().Overlay.as_ref().unwrap().read().LowerExists; if lowerExists { return overlayCreateWhiteout(&mut oldParentUpper, &oldName); } return Ok(()) } pub fn overlayBind(task: &Task, o: &Arc<RwLock<OverlayEntry>>, name: &str, data: &BoundEndpoint, perm: &FilePermissions) -> Result<Dirent> { let overlay = o.write(); // We do not support doing anything exciting with sockets unless there // is already a directory in the upper filesystem. if overlay.upper.is_none() { return Err(Error::SysError(SysErr::EOPNOTSUPP)) } let upperInode = overlay.upper.as_ref().unwrap().clone(); let iops = upperInode.lock().InodeOp.clone(); let d = iops.Bind(task, &upperInode, name, data, perm)?; let inode = d.Inode(); let msrc = inode.lock().MountSource.clone(); // Create a new overlay entry and dirent for the socket. let entry = OverlayEntry::New(task, Some(inode), None, false)?; let oInode = NewOverlayInode(task, entry, &msrc); return Ok(Dirent::New(&oInode, name)) } pub fn overlayBoundEndpoint(task: &Task, o: &Arc<RwLock<OverlayEntry>>, path: &str) -> Option<BoundEndpoint> { let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); let iops = upperInode.lock().InodeOp.clone(); return iops.BoundEndpoint(task, &upperInode, path); } let lower = overlay.lower.as_ref().unwrap().clone(); let overlay = lower.lock().Overlay.clone(); match overlay { None => { let iops = lower.lock().InodeOp.clone(); return iops.BoundEndpoint(task, &lower, path); } Some(overlay) => { // Lower is not an overlay. Call BoundEndpoint directly. return overlayBoundEndpoint(task, &overlay, path) } } } pub fn overlayGetFile(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, flags: &FileFlags) -> Result<File> { if flags.Write { copyUp(task, d)? } let mut flags = flags.clone(); let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); let upper = OverlayFile(task, &upperInode, &flags)?; flags.Pread = upper.Flags().Pread; flags.PWrite = upper.Flags().PWrite; let overlayFileOps = OverlayFileOperations { upper: Mutex::new(Some(upper)), ..Default::default() }; let f = File::New(d, &flags, overlayFileOps); return Ok(f) } let lowerInode = overlay.lower.as_ref().unwrap().clone(); let lower = OverlayFile(task, &lowerInode, &flags)?; flags.Pread = lower.Flags().Pread; flags.PWrite = lower.Flags().PWrite; let overlayFileOps = OverlayFileOperations { upper: Mutex::new(Some(lower)), ..Default::default() }; let f = File::New(d, &flags, overlayFileOps); return Ok(f) } pub fn overlayUnstableAttr(task: &Task, o: &Arc<RwLock<OverlayEntry>>) -> Result<UnstableAttr> { let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); return upperInode.UnstableAttr(task); } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); return lowerInode.UnstableAttr(task); } } pub fn overlayStableAttr(o: &Arc<RwLock<OverlayEntry>>) -> StableAttr { let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); return upperInode.StableAttr(); } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); return lowerInode.StableAttr(); } } pub fn overlayGetxattr(o: &Arc<RwLock<OverlayEntry>>, name: &str) -> Result<String> { if HasPrefix(name, &XATTR_OVERLAY_PREFIX.to_string()) { return Err(Error::SysError(SysErr::ENODATA)) } let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); return upperInode.Getxattr(name); } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); return lowerInode.Getxattr(name); } } pub fn overlayListxattr(o: &Arc<RwLock<OverlayEntry>>) -> Result<Vec<String>> { let overlay = o.read(); let names = if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); upperInode.Listxattr()? } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); lowerInode.Listxattr()? }; let overlayPrefix = XATTR_OVERLAY_PREFIX.to_string(); let mut res = Vec::new(); for name in names { if !HasPrefix(&name, &overlayPrefix) { res.push(name) } } return Ok(res) } pub fn overlayCheck(task: &Task, o: &Arc<RwLock<OverlayEntry>>, p: &PermMask) -> Result<()> { let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); return upperInode.CheckPermission(task, p) } else { let mut p = *p; if p.write { p.write = false; p.read = true; } let lowerInode = overlay.lower.as_ref().unwrap().clone(); return lowerInode.check(task, &p) } } pub fn overlaySetPermissions(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, f: FilePermissions) -> bool { match copyUp(task, d) { Err(_) => return false, Ok(()) => (), }; let overlay = o.read(); let mut upperInode = overlay.upper.as_ref().unwrap().clone(); let upperInodeOps = upperInode.lock().InodeOp.clone(); return upperInodeOps.SetPermissions(task, &mut upperInode, f) } pub fn overlaySetOwner(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, owner: &FileOwner) -> Result<()> { copyUp(task, d)?; let overlay = o.read(); let mut upperInode = overlay.upper.as_ref().unwrap().clone(); let upperInodeOps = upperInode.lock().InodeOp.clone(); return upperInodeOps.SetOwner(task, &mut upperInode, owner) } pub fn overlaySetTimestamps(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, ts: &InterTimeSpec) -> Result<()> { copyUp(task, d)?; let overlay = o.read(); let mut upperInode = overlay.upper.as_ref().unwrap().clone(); let upperInodeOps = upperInode.lock().InodeOp.clone(); return upperInodeOps.SetTimestamps(task, &mut upperInode, ts) } pub fn overlayTruncate(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, size: i64) -> Result<()> { copyUp(task, d)?; let overlay = o.read(); let mut upperInode = overlay.upper.as_ref().unwrap().clone(); let upperInodeOps = upperInode.lock().InodeOp.clone(); return upperInodeOps.Truncate(task, &mut upperInode, size) } pub fn overlayAllocate(task: &Task, o: &Arc<RwLock<OverlayEntry>>, d: &Dirent, offset: i64, length: i64) -> Result<()> { copyUp(task, d)?; let overlay = o.read(); let mut upperInode = overlay.upper.as_ref().unwrap().clone(); let upperInodeOps = upperInode.lock().InodeOp.clone(); return upperInodeOps.Allocate(task, &mut upperInode, offset, length) } pub fn overlayReadlink(task: &Task, o: &Arc<RwLock<OverlayEntry>>) -> Result<String> { let overlay = o.read(); if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); return upperInode.ReadLink(task); } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); return lowerInode.ReadLink(task); } } pub fn overlayGetlink(task: &Task, o: &Arc<RwLock<OverlayEntry>>) -> Result<Dirent> { let overlay = o.read(); let _dirent = if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); upperInode.GetLink(task)? } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); lowerInode.GetLink(task)? }; //todo: fix it /* if dirent != nil { // This dirent is likely bogus (its Inode likely doesn't contain // the right overlayEntry). So we're forced to drop it on the // ground and claim that jumping around the filesystem like this // is not supported. name, _ := dirent.FullName(nil) dirent.DecRef() // Claim that the path is not accessible. err = syserror.EACCES log.Warningf("Getlink not supported in overlay for %q", name) } return nil, err */ panic!("overlayGetlink: get dirent"); } pub fn overlayStatFS(task: &Task, o: &Arc<RwLock<OverlayEntry>>) -> Result<FsInfo> { let overlay = o.read(); let mut info = if overlay.upper.is_some() { let upperInode = overlay.upper.as_ref().unwrap().clone(); upperInode.StatFS(task)? } else { let lowerInode = overlay.lower.as_ref().unwrap().clone(); lowerInode.StatFS(task)? }; info.Type = FSMagic::OVERLAYFS_SUPER_MAGIC; return Ok(info) }
mod algo; pub use algo::*; mod edges; pub use edges::*; mod graph; pub use graph::*; mod traversal; pub use traversal::*; mod visit; pub use visit::*; pub mod prelude; // Index into the NodeIndex and EdgeIndex arrays /// Edge direction. #[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Ord, Eq, Hash)] #[repr(usize)] pub enum Direction { /// An `Outgoing` edge is an outward edge *from* the current node. Outgoing = 0, /// An `Incoming` edge is an inbound edge *to* the current node. Incoming = 1, }
pub fn raindrops(n: u32) -> String { let mut raindrop_sound = "".to_owned(); if n%3 == 0 { raindrop_sound.push_str("Pling") } if n%5 == 0 { raindrop_sound.push_str("Plang") } if n%7 == 0 { raindrop_sound.push_str("Plong") } if raindrop_sound.is_empty() { raindrop_sound = n.to_string(); } return raindrop_sound }
extern crate sdl2; extern crate imgui; use sdl2::sys as sdl2_sys; use imgui::sys as imgui_sys; use sdl2::video::Window; use sdl2::EventPump; use sdl2::mouse::{Cursor,SystemCursor}; use imgui::{ImGui,ImGuiMouseCursor}; use std::time::Instant; use std::os::raw::{c_char, c_void}; use sdl2::event::Event; pub struct ImguiSdl2 { last_frame: Instant, mouse_press: [bool; 5], ignore_mouse: bool, ignore_keyboard: bool, cursor: (ImGuiMouseCursor, Option<Cursor>), } impl ImguiSdl2 { pub fn new( imgui: &mut ImGui, ) -> Self { // TODO: upstream to imgui-rs { let io = unsafe { &mut *imgui_sys::igGetIO() }; io.get_clipboard_text_fn = Some(get_clipboard_text); io.set_clipboard_text_fn = Some(set_clipboard_text); io.clipboard_user_data = std::ptr::null_mut(); } { use sdl2::keyboard::Scancode; use imgui::ImGuiKey; imgui.set_imgui_key(ImGuiKey::Tab, Scancode::Tab as u8); imgui.set_imgui_key(ImGuiKey::LeftArrow, Scancode::Left as u8); imgui.set_imgui_key(ImGuiKey::RightArrow, Scancode::Right as u8); imgui.set_imgui_key(ImGuiKey::UpArrow, Scancode::Up as u8); imgui.set_imgui_key(ImGuiKey::DownArrow, Scancode::Down as u8); imgui.set_imgui_key(ImGuiKey::PageUp, Scancode::PageUp as u8); imgui.set_imgui_key(ImGuiKey::PageDown, Scancode::PageDown as u8); imgui.set_imgui_key(ImGuiKey::Home, Scancode::Home as u8); imgui.set_imgui_key(ImGuiKey::End, Scancode::End as u8); imgui.set_imgui_key(ImGuiKey::Delete, Scancode::Delete as u8); imgui.set_imgui_key(ImGuiKey::Backspace, Scancode::Backspace as u8); imgui.set_imgui_key(ImGuiKey::Enter, Scancode::Return as u8); imgui.set_imgui_key(ImGuiKey::Escape, Scancode::Escape as u8); imgui.set_imgui_key(ImGuiKey::A, Scancode::A as u8); imgui.set_imgui_key(ImGuiKey::C, Scancode::C as u8); imgui.set_imgui_key(ImGuiKey::V, Scancode::V as u8); imgui.set_imgui_key(ImGuiKey::X, Scancode::X as u8); imgui.set_imgui_key(ImGuiKey::Y, Scancode::Y as u8); imgui.set_imgui_key(ImGuiKey::Z, Scancode::Z as u8); } Self { last_frame: Instant::now(), mouse_press: [false; 5], ignore_keyboard: false, ignore_mouse: false, cursor: (ImGuiMouseCursor::None, None), } } pub fn ignore_event( &self, event: &Event, ) -> bool { match *event { Event::KeyDown{..} | Event::KeyUp{..} | Event::TextEditing{..} | Event::TextInput{..} => self.ignore_keyboard, Event::MouseMotion{..} | Event::MouseButtonDown{..} | Event::MouseButtonUp{..} | Event::MouseWheel{..} | Event::FingerDown{..} | Event::FingerUp{..} | Event::FingerMotion{..} | Event::DollarGesture{..} | Event::DollarRecord{..} | Event::MultiGesture{..} => self.ignore_mouse, _ => false, } } pub fn handle_event( &mut self, imgui: &mut ImGui, event: &Event, ) { use sdl2::mouse::MouseButton; use sdl2::keyboard; fn set_mod(imgui: &mut ImGui, keymod: keyboard::Mod) { let ctrl = keymod.intersects(keyboard::RCTRLMOD | keyboard::LCTRLMOD); let alt = keymod.intersects(keyboard::RALTMOD | keyboard::LALTMOD); let shift = keymod.intersects(keyboard::RSHIFTMOD | keyboard::LSHIFTMOD); let super_ = keymod.intersects(keyboard::RGUIMOD | keyboard::LGUIMOD); imgui.set_key_ctrl(ctrl); imgui.set_key_alt(alt); imgui.set_key_shift(shift); imgui.set_key_super(super_); } match *event { Event::MouseWheel{y, ..} => { imgui.set_mouse_wheel(y as f32); }, Event::MouseButtonDown{mouse_btn, ..} => { if mouse_btn != MouseButton::Unknown { let index = match mouse_btn { MouseButton::Left => 0, MouseButton::Right => 1, MouseButton::Middle => 2, MouseButton::X1 => 3, MouseButton::X2 => 4, MouseButton::Unknown => unreachable!(), }; self.mouse_press[index] = true; } }, Event::TextInput{ref text, .. } => { for chr in text.chars() { imgui.add_input_character(chr); } }, Event::KeyDown{scancode, keymod, .. } => { set_mod(imgui, keymod); if let Some(scancode) = scancode { imgui.set_key(scancode as u8, true); } }, Event::KeyUp{scancode, keymod, .. } => { set_mod(imgui, keymod); if let Some(scancode) = scancode { imgui.set_key(scancode as u8, false); } }, _ => {}, } } pub fn frame<'ui>( &mut self, window: &Window, imgui: &'ui mut ImGui, event_pump: &EventPump, ) -> imgui::Ui<'ui> { let mouse_util = window.subsystem().sdl().mouse(); // Merging the mousedown events we received into the current state prevents us from missing // clicks that happen faster than a frame let mouse_state = event_pump.mouse_state(); let mouse_down = [ self.mouse_press[0] || mouse_state.left(), self.mouse_press[1] || mouse_state.right(), self.mouse_press[2] || mouse_state.middle(), self.mouse_press[3] || mouse_state.x1(), self.mouse_press[4] || mouse_state.x2(), ]; imgui.set_mouse_down(mouse_down); self.mouse_press = [false; 5]; let any_mouse_down = mouse_down.iter().any(|&b| b); mouse_util.capture(any_mouse_down); imgui.set_mouse_pos(mouse_state.x() as f32, mouse_state.y() as f32); let mouse_cursor = imgui.mouse_cursor(); if imgui.mouse_draw_cursor() || mouse_cursor == ImGuiMouseCursor::None { self.cursor = (ImGuiMouseCursor::None, None); mouse_util.show_cursor(false); } else { mouse_util.show_cursor(true); if mouse_cursor != self.cursor.0 { let sdl_cursor = match mouse_cursor { ImGuiMouseCursor::None => unreachable!("mouse_cursor was None!"), ImGuiMouseCursor::Arrow => SystemCursor::Arrow, ImGuiMouseCursor::TextInput => SystemCursor::IBeam, ImGuiMouseCursor::Move => SystemCursor::SizeAll, ImGuiMouseCursor::ResizeNS => SystemCursor::SizeNS, ImGuiMouseCursor::ResizeEW => SystemCursor::SizeWE, ImGuiMouseCursor::ResizeNESW => SystemCursor::SizeNESW, ImGuiMouseCursor::ResizeNWSE => SystemCursor::SizeNWSE, }; let sdl_cursor = Cursor::from_system(sdl_cursor).unwrap(); sdl_cursor.set(); self.cursor = (mouse_cursor, Some(sdl_cursor)); } } let now = Instant::now(); let delta = now - self.last_frame; let delta_s = delta.as_secs() as f32 + delta.subsec_nanos() as f32 / 1_000_000_000.0; self.last_frame = now; let window_size = window.size(); let display_size = window.drawable_size(); let frame_size = imgui::FrameSize{ logical_size: (window_size.0 as f64, window_size.1 as f64), hidpi_factor: (display_size.0 as f64) / (window_size.0 as f64), }; let ui = imgui.frame(frame_size, delta_s); self.ignore_keyboard = ui.want_capture_keyboard(); self.ignore_mouse = ui.want_capture_mouse(); ui } } #[doc(hidden)] pub extern "C" fn get_clipboard_text(_user_data: *mut c_void) -> *const c_char { unsafe { sdl2_sys::SDL_GetClipboardText() } } #[doc(hidden)] #[cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))] pub extern "C" fn set_clipboard_text(_user_data: *mut c_void, text: *const c_char) { unsafe { sdl2_sys::SDL_SetClipboardText(text) }; }
use dlal_component_base::component; use std::f32::consts::PI; component!( {"in": [], "out": ["audio"]}, [ "run_size", "sample_rate", "uni", "check_audio", {"name": "field_helpers", "fields": ["freq", "amp"], "kinds": ["rw", "json"]}, ], { freq: f32, amp: f32, phase: f32, }, {}, ); impl ComponentTrait for Component { fn init(&mut self) { self.freq = 1.0; self.amp = 0.1; } fn run(&mut self) { let step = 2.0 * PI * self.freq / self.sample_rate as f32; if let Some(output) = self.output.as_ref() { let audio = output.audio(self.run_size).unwrap(); for i in 0..self.run_size { audio[i] += self.amp * self.phase.sin(); self.phase += step; } } else { self.phase += step * self.run_size as f32; } if self.phase > 2.0 * PI { self.phase -= 2.0 * PI; } } }
//! Data structures used to read the content streams of a compressed file, //! i.e. sequences of indices that map either into a static dictionary //! or into a dynamic dictionary. use bytes::varnum::ReadVarNum; use TokenReaderError; use binjs_shared::SharedString; use std::io::Cursor; /// A data structure used to read a content stream, sequences of indices /// that map either into a static dictionary or into a dynamic dictionary. /// /// `T` is the type of items in the dictionary, e.g. `Option<u32>`, `IdentifierName`, /// ... pub struct DictionaryStreamDecoder<'a, T> { /// A dictionary shared between many files. shared_dictionary: &'a [T], /// A dictionary defined in the prelude of the current file. prelude_dictionary: Vec<T>, /// A stream of varnums. Each varnum `n` is an index into either the shared_dictionary /// (if `n < shared_dictionary.len()`) or the prelude dictionary (otherwise). /// /// May be `None` if the file does not actually contain a content stream. stream: Option<Cursor<Vec<u8>>>, /// The name of this dictionary. Used for debugging/error reporting. name: SharedString, } impl<'a, T> DictionaryStreamDecoder<'a, T> { /// Create a decoder from a shared dictionary, a prelude dictionary and a stream of varnum-encoded values. pub fn new( shared_dictionary: &'a [T], prelude_dictionary: Vec<T>, name: SharedString, stream: Option<Vec<u8>>, ) -> Self { debug!(target: "read", "DictionaryStreamDecoder::new {} a {}", name.as_str(), match stream { None => "EMPTY stream".to_string(), Some(ref vec) => format!("non-empty ({} bytes) stream", vec.len()) } ); Self { shared_dictionary, prelude_dictionary, stream: stream.map(Cursor::new), name, } } } impl<'a, T> Iterator for DictionaryStreamDecoder<'a, T> where T: Clone + std::fmt::Debug, { type Item = Result<T, TokenReaderError>; fn next(&mut self) -> Option<Self::Item> { debug!(target: "read", "DictionaryStreamDecoder::next on a {} stream", match self.stream { None => "EMPTY", _ => "non-empty" } ); match self.stream { None => return None, Some(ref mut stream) => { debug!(target: "read", "DictionaryStreamDecoder::next position: {} / {}", stream.position(), stream.get_ref().len()); if stream.position() == stream.get_ref().len() as u64 { // We have reached the end of this stream. return None; } let index = match stream.read_varnum() { Ok(result) => result as usize, Err(err) => return Some(Err(TokenReaderError::ReadError(err))), }; debug!(target: "read", "DictionaryStreamDecoder::next index: {}", index); if index < self.shared_dictionary.len() { debug!(target: "read", "That's in the shared dictionary"); return Some(Ok(self.shared_dictionary[index].clone())); } if index < self.shared_dictionary.len() + self.prelude_dictionary.len() { debug!(target: "read", "That's in the prelude dictionary, at index {}: {:?}", index - self.shared_dictionary.len(), self.prelude_dictionary ); return Some(Ok(self.prelude_dictionary [index - self.shared_dictionary.len()] .clone())); } return Some(Err(TokenReaderError::BadDictionaryIndex { index: index as u32, dictionary: self.name.clone(), })); } } } }
#[macro_export] macro_rules! error_and_panic { ($message:expr) => {{ error!("{}", $message); panic!($message); }}; ($message:expr, $error:expr) => {{ error!("{}: [{}]", $message, $error); panic!("{}: [{}]", $message, $error); }}; } #[macro_export] macro_rules! log_and_throw { ($message:expr) => {{ error!("{}", $message); return Err(AppError { kind: "Application", message: $message, }); }}; ($message:expr, $error:expr) => {{ let message = format!("{}: [{}]", $message, $error); error!("{}", message); return Err($error); }}; }
use libc; use std::{ env, fs::File, io::{self, BufWriter, Write}, path::Path, }; fn main() { let output_dir = env::var("OUT_DIR").expect("Could not determine OUT_DIR from environment"); generate_os_consts_file(output_dir).expect("Failed to write OS consts file"); } fn generate_os_consts_file<T: AsRef<Path>>(output_path: T) -> io::Result<()> { let path = output_path.as_ref().join("os_consts.rs"); let mut file = BufWriter::new(File::create(&path)?); let page_size: usize = get_system_page_size() as usize; writeln!(&mut file, "pub const PAGE_SIZE: usize = {};", page_size)?; Ok(()) } fn get_system_page_size() -> ::libc::c_long { unsafe { ::libc::sysconf(libc::_SC_PAGESIZE) } }
// This file is part of linux-epoll. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. No part of linux-epoll, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright © 2019 The developers of linux-epoll. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. macro_rules! parse_and_ignore_bytes_label { ($label: ident, $current_label_starts_at_pointer: ident, $maximum_for_end_of_name_pointer: ident, $_labels_register_reference: ident, $number_of_labels: ident, $name_length: ident) => { { let length = $label.length(); parse_bytes_label!(length, $current_label_starts_at_pointer, $maximum_for_end_of_name_pointer, $number_of_labels, $name_length) } } }
mod handler; mod nrsync; #[macro_use] extern crate log; use clap::Clap; use env_logger::{Builder, Target}; use std::env; macro_rules! crate_version { () => { env!("CARGO_PKG_VERSION") }; } #[derive(Clap)] #[clap(version= crate_version!(), author = "Kavashen Pather")] pub struct Opts { /// New Relic Account ID #[clap(short = "a", env = "NR_ACCOUNT_ID")] account_id: String, /// New Relic One API Key #[clap(short = "k", env = "NR_API_KEY")] api_key: String, /// NerdPack UUID of the Integrations Manager #[clap(short = "u", env = "NR_UUID")] uuid: String, /// Config Collection to sync with #[clap(short = "c", env = "NR_COLLECTION")] collection: String, /// Verbose logging #[clap(short, env = "VERBOSE")] verbose: bool, } #[tokio::main] async fn main() { let opts: Opts = Opts::parse(); if opts.verbose { env::set_var("RUST_LOG", "debug") } let mut builder = Builder::from_default_env(); builder.target(Target::Stderr); // use stderr so infra agent doesn't complain builder.init(); nrsync::start(opts).await; }
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /// Tests for Bonding procedures pub mod bonding; /// Tests for the fuchsia.bluetooth.control.Control protocol pub mod control; /// Tests for the Bluetooth Host driver behavior pub mod host_driver; /// Tests for the fuchsia.bluetooth.le.Central protocol pub mod low_energy_central; /// Tests for the fuchsia.bluetooth.le.Peripheral protocol pub mod low_energy_peripheral; /// Tests for the fuchsia.bluetooth.bredr.Profile protocol pub mod profile;
use std::io::{Read, Result as IOResult}; use crate::{PrimitiveRead, StringRead}; pub struct Model { pub name: String, pub model_type: i32, pub bounding_radius: f32, pub meshes_count: i32, pub mesh_index: u64, pub vertices_count: i32, pub vertex_index: i32, pub tangents_index: i32, pub attachments_count: i32, pub attachment_index: i32, pub eye_balls_count: i32, pub eye_ball_index: i32, pub vertex_data : ModelVertexData } pub struct ModelVertexData { _unknown: [u8; 8] } impl ModelVertexData { pub fn read(read: &mut dyn Read) -> IOResult<Self> { let mut data = [0u8; 8]; read.read_exact(&mut data)?; Ok(Self { _unknown: data }) } } impl Model { pub fn read(read: &mut dyn Read) -> IOResult<Self> { let name = read.read_fixed_length_null_terminated_string(64).unwrap(); let model_type = read.read_i32()?; let bounding_radius = read.read_f32()?; let meshes_count = read.read_i32()?; let mesh_index = read.read_i32()?; let vertices_count = read.read_i32()?; let vertex_index = read.read_i32()?; let tangents_index = read.read_i32()?; let attachments_count = read.read_i32()?; let attachment_index = read.read_i32()?; let eye_balls_count = read.read_i32()?; let eye_ball_index = read.read_i32()?; let vertex_data = ModelVertexData::read(read)?; for _ in 0..8 { read.read_i32()?; } Ok(Self { name, model_type, bounding_radius, meshes_count, mesh_index: mesh_index as u64, vertices_count, vertex_index, tangents_index, attachment_index, attachments_count, eye_ball_index, eye_balls_count, vertex_data }) } }
use std::cmp::{max, min}; use std::collections::{BinaryHeap, HashMap, HashSet}; use itertools::Itertools; use whiteread::parse_line; // ワーシャル フロイド 法 // kを中継地点としてkを小さい順にO(n^3)で最短路を求めるdpを使っている方法 // 本当はn * nのdpで十分 fn main() { let (n, m): (usize, usize) = parse_line().unwrap(); let mut map: Vec<Vec<usize>> = vec![vec![std::usize::MAX; n + 1]; n + 1]; for _ in 0..m { let (a, b, c): (usize, usize, usize) = parse_line().unwrap(); map[a][b] = c; } let mut memo: Vec<Vec<Vec<usize>>> = vec![vec![vec![std::usize::MAX; n + 1]; n + 1]; n + 1]; for s in 1..=n { for t in 1..=n { memo[s][t][0] = map[s][t]; } } for k in 0..=n { for s in 1..=n { memo[s][s][k] = 0; } } let mut ans = 0; for k in 1..=n { for s in 1..=n { for t in 1..=n { if s == t { continue; } if memo[s][k][k - 1] == std::usize::MAX || memo[k][t][k - 1] == std::usize::MAX { memo[s][t][k] = memo[s][t][k - 1]; } else { memo[s][t][k] = min(memo[s][k][k - 1] + memo[k][t][k - 1], memo[s][t][k - 1]); } if memo[s][t][k] == std::usize::MAX { continue; } ans += memo[s][t][k]; } } } println!("{}", ans); }
use std::fmt; use std::ops::Range; use std::str; use std::sync::Arc; use bstr::{BStr, ByteSlice}; use bytes::Bytes; use thiserror::Error; use crate::object::{Id, Parser, ID_LEN}; #[derive(Clone)] pub struct Tree { data: Bytes, entries: Arc<[TreeEntryRaw]>, } pub struct TreeEntry<'a> { data: &'a [u8], entry: TreeEntryRaw, } #[derive(Debug, Error)] #[error("{0}")] pub(in crate::object) struct ParseTreeError(&'static str); #[derive(Clone)] struct TreeEntryRaw { mode: u16, id: usize, filename: Range<usize>, } impl Tree { pub(in crate::object) fn parse(mut parser: Parser<Bytes>) -> Result<Self, ParseTreeError> { let mut entries = Vec::with_capacity(parser.remaining() / 140); while !parser.finished() { let mode = parser .consume_until(b' ') .ok_or(ParseTreeError("invalid mode"))?; let mode = str::from_utf8(&parser[mode]).map_err(|_| ParseTreeError("invalid mode"))?; let mode = u16::from_str_radix(mode, 8).map_err(|_| ParseTreeError("invalid mode"))?; let filename = parser .consume_until(0) .ok_or(ParseTreeError("invalid filename"))?; let id = parser.pos(); if !parser.advance(ID_LEN) { return Err(ParseTreeError("invalid id")); } entries.push(TreeEntryRaw { mode, filename, id }) } Ok(Tree { data: parser.into_inner(), entries: Arc::from(entries.as_slice()), }) } pub fn entries(&self) -> impl ExactSizeIterator<Item = TreeEntry> { self.entries.iter().cloned().map(move |entry| TreeEntry { data: &self.data, entry, }) } } impl<'a> TreeEntry<'a> { pub fn mode(&self) -> u16 { self.entry.mode } pub fn id(&self) -> Id { Id::from_bytes(&self.data[self.entry.id..][..ID_LEN]) } pub fn filename(&self) -> &'a BStr { self.data[self.entry.filename.clone()].as_bstr() } } impl fmt::Debug for Tree { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_list().entries(self.entries()).finish() } } impl<'a> fmt::Debug for TreeEntry<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("TreeEntry") .field("mode", &self.mode()) .field("id", &self.id()) .field("filename", &self.filename()) .finish() } } #[cfg(test)] mod tests { use crate::object::{Parser, Tree}; #[test] fn test_parse_tree() { let parser = Parser::new( b"\ 40000 .github\0\x49\x19\x89\xb9\x30\xc1\xe5\xd0\x83\xa4\xd2\xa1\xf7\xfa\x42\xaa\xa8\x6c\x13\x75\ 100644 .gitignore\0\x69\x36\x99\x04\x2b\x1a\x8c\xcf\x69\x76\x36\xd3\xcd\x34\xb2\x00\xf3\xa8\x27\x8b\ " .to_vec() .into(), ); let tree = Tree::parse(parser).unwrap(); let entries: Vec<_> = tree.entries().collect(); assert_eq!(entries[0].mode(), 16384); assert_eq!( entries[0].id().to_hex(), "491989b930c1e5d083a4d2a1f7fa42aaa86c1375" ); assert_eq!(entries[0].filename(), ".github"); assert_eq!(entries[1].mode(), 33188); assert_eq!( entries[1].id().to_hex(), "693699042b1a8ccf697636d3cd34b200f3a8278b" ); assert_eq!(entries[1].filename(), ".gitignore"); } }
use serde::Serialize; use std::{ cell::RefCell, collections::{HashMap, HashSet, VecDeque}, ops::DerefMut, path::PathBuf, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, }; use steamworks::{PublishedFileId, QueryResult, QueryResults, SteamError, SteamId}; use parking_lot::Mutex; use super::{users::SteamUser, Steam}; use crate::{main_thread_forbidden, webview::Addon, GMOD_APP_ID}; #[derive(Serialize, Clone, Debug)] #[serde(rename_all = "camelCase")] pub struct WorkshopItem { pub id: PublishedFileId, pub title: String, pub owner: Option<SteamUser>, pub time_created: u32, pub time_updated: u32, pub description: Option<String>, pub score: f32, pub tags: Vec<String>, pub preview_url: Option<String>, pub subscriptions: u64, pub local_file: Option<PathBuf>, //pub search_title: String, #[serde(serialize_with = "super::serialize_opt_steamid", rename = "steamid64")] pub steamid: Option<SteamId>, pub dead: bool, } impl From<QueryResult> for WorkshopItem { fn from(result: QueryResult) -> Self { WorkshopItem { id: result.published_file_id, title: result.title.clone(), steamid: Some(result.owner), owner: None, time_created: result.time_created, time_updated: result.time_updated, description: Some(result.description), // TODO parse or strip bbcode? score: result.score, tags: result.tags, preview_url: None, subscriptions: 0, local_file: None, //search_title: result.title.to_lowercase(), dead: false, } } } impl From<PublishedFileId> for WorkshopItem { fn from(id: PublishedFileId) -> Self { WorkshopItem { id, title: id.0.to_string(), steamid: None, owner: None, time_created: 0, time_updated: 0, description: None, score: 0., tags: Vec::with_capacity(0), preview_url: None, subscriptions: 0, local_file: None, //search_title: id.0.to_string(), dead: true, } } } impl PartialEq for WorkshopItem { fn eq(&self, other: &Self) -> bool { if self.time_created == 0 { if self.time_updated == 0 { self.id.eq(&other.id) } else { self.time_updated.eq(&other.time_updated) } } else { if other.time_created == 0 { self.id.eq(&other.id) } else { self.time_created.eq(&other.time_created) } } } } impl Eq for WorkshopItem {} impl PartialOrd for WorkshopItem { fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { if self.time_created == 0 { if self.time_updated == 0 { self.id.partial_cmp(&other.id) } else { self.time_updated.partial_cmp(&other.time_updated) } } else { if other.time_created == 0 { self.id.partial_cmp(&other.id) } else { self.time_created.partial_cmp(&other.time_created) } } } } impl Ord for WorkshopItem { fn cmp(&self, other: &Self) -> std::cmp::Ordering { if self.time_created == 0 { if self.time_updated == 0 { self.id.cmp(&other.id) } else { self.time_updated.cmp(&other.time_updated) } } else { if other.time_created == 0 { self.id.cmp(&other.id) } else { self.time_created.cmp(&other.time_created) } } } } #[derive(derive_more::Deref)] struct FetcherBacklog(RefCell<VecDeque<PublishedFileId>>); unsafe impl Sync for FetcherBacklog {} lazy_static! { static ref FETCHER_BACKLOG: FetcherBacklog = FetcherBacklog(RefCell::new(VecDeque::new())); static ref FETCHER_NEXT: AtomicBool = AtomicBool::new(false); } impl Steam { pub fn workshop_fetcher() { loop { steam!().workshop.write(|workshop| { if workshop.1.is_empty() { FETCHER_NEXT.store(true, Ordering::Release); return; } else { FETCHER_NEXT.store(false, Ordering::Release); } let mut backlog = FETCHER_BACKLOG.borrow_mut(); backlog.reserve(workshop.1.len()); for data in workshop.1.drain(..).into_iter() { backlog.push_back(data); } drop(workshop); while !backlog.is_empty() { let backlog_len = backlog.len(); let mut queue = backlog.split_off((steamworks::RESULTS_PER_PAGE as usize).min(backlog_len)); std::mem::swap(&mut queue, &mut *backlog); let queue: Vec<PublishedFileId> = queue.into(); let next = Arc::new(AtomicBool::new(false)); let next_ref = next.clone(); search!().reserve(queue.len()); steam!() .client() .ugc() .query_items(queue.to_owned()) .unwrap() .allow_cached_response(600) .fetch(move |results: Result<QueryResults<'_>, SteamError>| { if let Ok(results) = results { let mut i = 0; for item in results.iter() { let item = Addon::from(if let Some(item) = item { let mut item: WorkshopItem = item.into(); item.preview_url = results.preview_url(i); item.subscriptions = results.statistic(i, steamworks::UGCStatisticType::Subscriptions).unwrap_or(0); item } else { WorkshopItem::from(queue[i as usize]) }); steam!().workshop_channel.data(item); i += 1; } } else { steam!().workshop.write(move |workshop| { for id in queue.into_iter() { workshop.0.remove(&id); } }); } next_ref.store(true, Ordering::Release); }); while !next.load(Ordering::Acquire) { steam!().run_callbacks(); } } FETCHER_NEXT.store(true, Ordering::Release); }); sleep_ms!(50); while !FETCHER_NEXT.load(Ordering::Acquire) { sleep_ms!(50); } } } pub fn fetch_workshop_items(&'static self, ids: Vec<PublishedFileId>) { self.workshop.write(move |workshop| { let (cache, queue) = workshop.deref_mut(); queue.reserve(ids.len()); for id in ids.into_iter().filter(|id| cache.insert(*id)) { queue.push(id); } }); } // Collections // pub fn fetch_collection_items(&'static self, collection: PublishedFileId) -> Option<Vec<PublishedFileId>> { main_thread_forbidden!(); let response = Arc::new(Mutex::new(None)); { let response = response.clone(); self.client() .ugc() .query_item(collection) .unwrap() .include_children(true) .fetch(move |query: Result<QueryResults<'_>, SteamError>| { if let Ok(results) = query { if let Some(result) = results.get(0) { if matches!(result.file_type, steamworks::FileType::Collection) { if let Some(children) = results.get_children(0) { if !children.is_empty() { *response.lock() = Some(Some(children)); return; } } } } } *response.lock() = Some(None); }); } mutex_wait!(response, { self.run_callbacks(); }); Arc::try_unwrap(response).unwrap().into_inner().unwrap() } pub fn fetch_collection_items_async<F>(&'static self, collection: PublishedFileId, f: F) where F: FnOnce(&Option<Vec<PublishedFileId>>) + 'static + Send, { rayon::spawn(move || f(&self.fetch_collection_items(collection))); } pub fn browse_my_workshop(&'static self, page: u32) -> Option<(u32, Vec<Addon>)> { let results = Arc::new(Mutex::new(None)); let results_ref = results.clone(); let client = self.client(); client .ugc() .query_user( client.steam_id.account_id(), steamworks::UserList::Published, steamworks::UGCType::ItemsReadyToUse, steamworks::UserListOrder::LastUpdatedDesc, steamworks::AppIDs::ConsumerAppId(GMOD_APP_ID), page, ) .ok()? .require_tag("addon") .allow_cached_response(600) .fetch(move |result: Result<QueryResults<'_>, SteamError>| { if let Ok(data) = result { *results_ref.lock() = Some(Some(( data.total_results(), data.iter() .enumerate() .map(|(i, x)| { let mut item: WorkshopItem = x.unwrap().into(); item.preview_url = data.preview_url(i as u32); item.subscriptions = data.statistic(i as u32, steamworks::UGCStatisticType::Subscriptions).unwrap_or(0); search!().add(&item); item.into() }) .collect::<Vec<Addon>>(), ))); } else { *results_ref.lock() = Some(None); } }); mutex_wait!(results, { self.run_callbacks(); }); Arc::try_unwrap(results).unwrap().into_inner().unwrap() } } #[tauri::command] pub fn browse_my_workshop(page: u32) -> Option<(u32, Vec<Addon>)> { steam!().client_wait(); rayon::scope(|_| steam!().browse_my_workshop(page)) } #[tauri::command] fn fetch_workshop_items(items: Vec<PublishedFileId>) { steam!().fetch_workshop_items(items); } #[tauri::command] fn fetch_workshop_item(item: PublishedFileId) { steam!().fetch_workshop_items(vec![item]); } #[tauri::command] fn workshop_item_channel() -> u32 { steam!().workshop_channel.id } pub fn free_caches() { *steam!().users.write_sync() = HashMap::new(); *steam!().workshop.write_sync() = (HashSet::new(), Vec::new()); }
#[doc = "Reader of register APB4FZ1"] pub type R = crate::R<u32, super::APB4FZ1>; #[doc = "Writer for register APB4FZ1"] pub type W = crate::W<u32, super::APB4FZ1>; #[doc = "Register APB4FZ1 `reset()`'s with value 0"] impl crate::ResetValue for super::APB4FZ1 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Reader of field `IWDG1`"] pub type IWDG1_R = crate::R<bool, bool>; #[doc = "Write proxy for field `IWDG1`"] pub struct IWDG1_W<'a> { w: &'a mut W, } impl<'a> IWDG1_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18); self.w } } #[doc = "Reader of field `RTC`"] pub type RTC_R = crate::R<bool, bool>; #[doc = "Write proxy for field `RTC`"] pub struct RTC_W<'a> { w: &'a mut W, } impl<'a> RTC_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); self.w } } #[doc = "Reader of field `LPTIM5`"] pub type LPTIM5_R = crate::R<bool, bool>; #[doc = "Write proxy for field `LPTIM5`"] pub struct LPTIM5_W<'a> { w: &'a mut W, } impl<'a> LPTIM5_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12); self.w } } #[doc = "Reader of field `LPTIM4`"] pub type LPTIM4_R = crate::R<bool, bool>; #[doc = "Write proxy for field `LPTIM4`"] pub struct LPTIM4_W<'a> { w: &'a mut W, } impl<'a> LPTIM4_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); self.w } } #[doc = "Reader of field `LPTIM3`"] pub type LPTIM3_R = crate::R<bool, bool>; #[doc = "Write proxy for field `LPTIM3`"] pub struct LPTIM3_W<'a> { w: &'a mut W, } impl<'a> LPTIM3_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); self.w } } #[doc = "Reader of field `LPTIM2`"] pub type LPTIM2_R = crate::R<bool, bool>; #[doc = "Write proxy for field `LPTIM2`"] pub struct LPTIM2_W<'a> { w: &'a mut W, } impl<'a> LPTIM2_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); self.w } } #[doc = "Reader of field `I2C4`"] pub type I2C4_R = crate::R<bool, bool>; #[doc = "Write proxy for field `I2C4`"] pub struct I2C4_W<'a> { w: &'a mut W, } impl<'a> I2C4_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Reader of field `IWDG2`"] pub type IWDG2_R = crate::R<bool, bool>; #[doc = "Write proxy for field `IWDG2`"] pub struct IWDG2_W<'a> { w: &'a mut W, } impl<'a> IWDG2_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); self.w } } impl R { #[doc = "Bit 18 - Independent watchdog for D1 stop in debug mode"] #[inline(always)] pub fn iwdg1(&self) -> IWDG1_R { IWDG1_R::new(((self.bits >> 18) & 0x01) != 0) } #[doc = "Bit 16 - RTC stop in debug mode"] #[inline(always)] pub fn rtc(&self) -> RTC_R { RTC_R::new(((self.bits >> 16) & 0x01) != 0) } #[doc = "Bit 12 - LPTIM5 stop in debug mode"] #[inline(always)] pub fn lptim5(&self) -> LPTIM5_R { LPTIM5_R::new(((self.bits >> 12) & 0x01) != 0) } #[doc = "Bit 11 - LPTIM4 stop in debug mode"] #[inline(always)] pub fn lptim4(&self) -> LPTIM4_R { LPTIM4_R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bit 10 - LPTIM3 stop in debug mode"] #[inline(always)] pub fn lptim3(&self) -> LPTIM3_R { LPTIM3_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 9 - LPTIM2 stop in debug mode"] #[inline(always)] pub fn lptim2(&self) -> LPTIM2_R { LPTIM2_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 7 - I2C4 SMBUS timeout stop in debug mode"] #[inline(always)] pub fn i2c4(&self) -> I2C4_R { I2C4_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 19 - Independent watchdog for D2 stop when Cortex-M7 in debug mode"] #[inline(always)] pub fn iwdg2(&self) -> IWDG2_R { IWDG2_R::new(((self.bits >> 19) & 0x01) != 0) } } impl W { #[doc = "Bit 18 - Independent watchdog for D1 stop in debug mode"] #[inline(always)] pub fn iwdg1(&mut self) -> IWDG1_W { IWDG1_W { w: self } } #[doc = "Bit 16 - RTC stop in debug mode"] #[inline(always)] pub fn rtc(&mut self) -> RTC_W { RTC_W { w: self } } #[doc = "Bit 12 - LPTIM5 stop in debug mode"] #[inline(always)] pub fn lptim5(&mut self) -> LPTIM5_W { LPTIM5_W { w: self } } #[doc = "Bit 11 - LPTIM4 stop in debug mode"] #[inline(always)] pub fn lptim4(&mut self) -> LPTIM4_W { LPTIM4_W { w: self } } #[doc = "Bit 10 - LPTIM3 stop in debug mode"] #[inline(always)] pub fn lptim3(&mut self) -> LPTIM3_W { LPTIM3_W { w: self } } #[doc = "Bit 9 - LPTIM2 stop in debug mode"] #[inline(always)] pub fn lptim2(&mut self) -> LPTIM2_W { LPTIM2_W { w: self } } #[doc = "Bit 7 - I2C4 SMBUS timeout stop in debug mode"] #[inline(always)] pub fn i2c4(&mut self) -> I2C4_W { I2C4_W { w: self } } #[doc = "Bit 19 - Independent watchdog for D2 stop when Cortex-M7 in debug mode"] #[inline(always)] pub fn iwdg2(&mut self) -> IWDG2_W { IWDG2_W { w: self } } }
pub enum ResponseCode { NoError, FormErr, ServFail, NXDomain, NotImp, Refused, YXDomain, YXRRSet, NXRRSet, NotAuth, NotZone, Unassigned(u8), } impl Default for ResponseCode { fn default() -> ResponseCode { ResponseCode::NoError } } pub fn unpack(value: u8) -> ResponseCode { return match value { 0x00 => ResponseCode::NoError, 0x01 => ResponseCode::FormErr, 0x02 => ResponseCode::ServFail, 0x03 => ResponseCode::NXDomain, 0x04 => ResponseCode::NotImp, 0x05 => ResponseCode::Refused, 0x06 => ResponseCode::YXDomain, 0x07 => ResponseCode::YXRRSet, 0x08 => ResponseCode::NXRRSet, 0x09 => ResponseCode::NotAuth, 0x0A => ResponseCode::NotZone, n => ResponseCode::Unassigned(n), }; } impl std::fmt::Display for ResponseCode { fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { match self { ResponseCode::NoError => write!(fmt, "No Error"), ResponseCode::FormErr => write!(fmt, "Format Error"), ResponseCode::ServFail => write!(fmt, "Server Failure"), ResponseCode::NXDomain => write!(fmt, "Non-Existent Domain"), ResponseCode::NotImp => write!(fmt, "Not Implemented"), ResponseCode::Refused => write!(fmt, "Refused"), ResponseCode::YXDomain => write!(fmt, "Name Exists when it should not"), ResponseCode::YXRRSet => write!(fmt, "RR Set Exists when it should not"), ResponseCode::NXRRSet => write!(fmt, "RR Set that should exist does not"), ResponseCode::NotAuth => write!(fmt, "Server Not Authoritative for zone"), ResponseCode::NotZone => write!(fmt, "Name not contained in zone"), ResponseCode::Unassigned(n) => write!(fmt, "Unassigned({})", n), } } }
pub use super::constants::*; pub use super::core::*; pub use super::ext::*; pub use super::khr::*; pub use super::nv::*; pub use super::types::*; pub use super::voidfunction::*;
pub mod guards; pub mod membership_token;
use super::*; use std::collections::*; use syn::parse::*; use syn::Ident; use syn::*; custom_keyword!(extend); #[derive(Default)] pub struct ImplementMacro { pub implement: BTreeSet<TypeDef>, pub extend: Option<TypeDef>, pub overrides: BTreeSet<&'static str>, } impl ImplementMacro { pub fn interfaces(&self) -> Vec<(TypeDef, bool)> { // TODO: any one of `self.implement` could be a class in which case its interfaces should be enumerated let mut result: Vec<(TypeDef, bool)> = self.implement.iter().map(|def| (def.clone(), false)).collect(); if let Some(extend) = &self.extend { for interface in extend.overridable_interfaces() { result.push((interface, true)); } } result } fn parse_implement(&mut self, reader: &'static TypeReader, cursor: ParseStream) -> Result<()> { let tree = cursor.parse::<UseTree2>()?; self.walk_implement(reader, &tree, &mut String::new())?; if !cursor.is_empty() { cursor.parse::<Token![,]>()?; } Ok(()) } fn walk_implement(&mut self, reader: &'static TypeReader, tree: &UseTree2, namespace: &mut String) -> Result<()> { match tree { UseTree2::Path(input) => { if !namespace.is_empty() { namespace.push('.'); } namespace.push_str(&input.ident.to_string()); self.walk_implement(reader, &*input.tree, namespace)?; } UseTree2::Name(input) => { if let ElementType::TypeDef(def) = tree.to_element_type(reader, namespace)? { self.implement.insert(def); } else { return Err(Error::new_spanned(&input.ident, format!("`{}.{}` is not a class or interface", namespace, input.ident))); } } UseTree2::Group(input) => { for tree in &input.items { self.walk_implement(reader, tree, namespace)?; } } } Ok(()) } fn parse_override(&mut self, cursor: ParseStream) -> Result<()> { // Any number of methods may be overridden but only if a class is being overridden. if let Some(extend) = &self.extend { while cursor.parse::<Token![override]>().is_ok() { let methods = extend.overridable_methods(); while let Ok(input) = cursor.parse::<Ident>() { let name = input.to_string(); if let Some(name) = methods.get(name.as_str()) { self.overrides.insert(name); } else { return Err(Error::new_spanned(input, format!("`{}` not an overridable method", name))); } } if !cursor.is_empty() { cursor.parse::<Token![,]>()?; } } } Ok(()) } fn parse_extend(&mut self, reader: &'static TypeReader, cursor: ParseStream) -> Result<()> { // Only one class may be extended if self.extend.is_none() && cursor.parse::<extend>().is_ok() { self.walk_extend(reader, &cursor.parse()?, &mut String::new())?; if !cursor.is_empty() { cursor.parse::<Token![,]>()?; } } Ok(()) } fn walk_extend(&mut self, reader: &'static TypeReader, tree: &UseTree2, namespace: &mut String) -> Result<()> { match tree { UseTree2::Path(input) => { if !namespace.is_empty() { namespace.push('.'); } namespace.push_str(&input.ident.to_string()); self.walk_extend(reader, &*input.tree, namespace)?; } UseTree2::Name(input) => { let name = input.ident.to_string(); if let Some(def) = get_public_composable(reader, namespace, &name) { self.extend.replace(def); } else { return Err(Error::new_spanned(&input.ident, format!("`{}.{}` not extendable", namespace, name))); } } UseTree2::Group(input) => { return Err(Error::new(input.brace_token.span, "Syntax not supported")); } } Ok(()) } } fn get_public_composable(reader: &'static TypeReader, namespace: &str, name: &str) -> Option<TypeDef> { if let Some(ElementType::TypeDef(def)) = reader.get_type((namespace, name)) { if def.is_public_composable() { return Some(def.clone()); } } None } fn get_implementable(reader: &'static TypeReader, namespace: &str, name: &str) -> Option<TypeDef> { if let Some(ElementType::TypeDef(def)) = reader.get_type((namespace, name)) { match def.kind() { TypeKind::Class | TypeKind::Interface => return Some(def.clone()), _ => {} } } None } impl Parse for ImplementMacro { fn parse(cursor: ParseStream) -> Result<Self> { let mut input = Self::default(); let reader = TypeReader::get(); input.parse_extend(reader, cursor)?; input.parse_override(cursor)?; while !cursor.is_empty() { input.parse_implement(reader, cursor)?; } Ok(input) } } pub enum UseTree2 { Path(UsePath2), Name(UseName2), Group(UseGroup2), } pub struct UsePath2 { pub ident: Ident, pub colon2_token: Token![::], pub tree: Box<UseTree2>, } pub struct UseName2 { pub ident: Ident, pub generics: Vec<UseTree2>, } pub struct UseGroup2 { pub brace_token: token::Brace, pub items: syn::punctuated::Punctuated<UseTree2, Token![,]>, } impl UseTree2 { fn to_element_type(&self, reader: &'static TypeReader, namespace: &mut String) -> Result<ElementType> { match self { UseTree2::Path(input) => { if !namespace.is_empty() { namespace.push('.'); } namespace.push_str(&input.ident.to_string()); input.tree.to_element_type(reader, namespace) } UseTree2::Name(input) => { let name = input.ident.to_string(); if reader.types.get_namespace(namespace).is_some() { if let Some(mut def) = get_implementable(reader, namespace, &name) { for g in &input.generics { def.generics.push(g.to_element_type(reader, &mut String::new())?); } Ok(ElementType::TypeDef(def)) } else { Err(Error::new_spanned(&input.ident, format!("`{}.{}` not a class or interface", namespace, name))) } } else if let Some(def) = ElementType::from_string_lossy(&name) { Ok(def) } else { Ok(ElementType::GenericParam(name)) } } UseTree2::Group(input) => Err(Error::new(input.brace_token.span, "Syntax not supported")), } } } impl Parse for UseTree2 { fn parse(input: ParseStream) -> Result<UseTree2> { let lookahead = input.lookahead1(); if lookahead.peek(Ident) { use syn::ext::IdentExt; let ident = input.call(Ident::parse_any)?; if input.peek(Token![::]) { Ok(UseTree2::Path(UsePath2 { ident, colon2_token: input.parse()?, tree: Box::new(input.parse()?) })) } else { let generics = if input.peek(Token![<]) { input.parse::<Token![<]>()?; let mut generics = Vec::new(); loop { generics.push(input.parse::<UseTree2>()?); if input.parse::<Token![,]>().is_err() { break; } } input.parse::<Token![>]>()?; generics } else { Vec::new() }; Ok(UseTree2::Name(UseName2 { ident, generics })) } } else if lookahead.peek(token::Brace) { let content; let brace_token = braced!(content in input); let items = content.parse_terminated(UseTree2::parse)?; Ok(UseTree2::Group(UseGroup2 { brace_token, items })) } else { Err(lookahead.error()) } } }
// auto generated, do not modify. // created: Mon Feb 22 23:57:02 2016 // src-file: /QtGui/qrawfont.h // dst-file: /src/gui/qrawfont.rs // // header block begin => #![feature(libc)] #![feature(core)] #![feature(collections)] extern crate libc; use self::libc::*; // <= header block end // main block begin => // <= main block end // use block begin => use std::ops::Deref; use super::super::core::qstring::*; // 771 use super::super::core::qrect::*; // 771 use super::super::core::qbytearray::*; // 771 use super::super::core::qchar::*; // 771 use super::qtransform::*; // 773 use super::super::core::qpoint::*; // 771 use super::qpainterpath::*; // 773 use super::qfont::*; // 773 // use super::qvector::*; // 775 // <= use block end // ext block begin => // #[link(name = "Qt5Core")] // #[link(name = "Qt5Gui")] // #[link(name = "Qt5Widgets")] // #[link(name = "QtInline")] extern { fn QRawFont_Class_Size() -> c_int; // proto: qreal QRawFont::averageCharWidth(); fn C_ZNK8QRawFont16averageCharWidthEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: qreal QRawFont::ascent(); fn C_ZNK8QRawFont6ascentEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: qreal QRawFont::leading(); fn C_ZNK8QRawFont7leadingEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: qreal QRawFont::lineThickness(); fn C_ZNK8QRawFont13lineThicknessEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: bool QRawFont::isValid(); fn C_ZNK8QRawFont7isValidEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QRectF QRawFont::boundingRect(quint32 glyphIndex); fn C_ZNK8QRawFont12boundingRectEj(qthis: u64 /* *mut c_void*/, arg0: c_uint) -> *mut c_void; // proto: bool QRawFont::supportsCharacter(uint ucs4); fn C_ZNK8QRawFont17supportsCharacterEj(qthis: u64 /* *mut c_void*/, arg0: c_uint) -> c_char; // proto: void QRawFont::swap(QRawFont & other); fn C_ZN8QRawFont4swapERS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: qreal QRawFont::descent(); fn C_ZNK8QRawFont7descentEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QRawFont::QRawFont(); fn C_ZN8QRawFontC2Ev() -> u64; // proto: void QRawFont::setPixelSize(qreal pixelSize); fn C_ZN8QRawFont12setPixelSizeEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: bool QRawFont::glyphIndexesForChars(const QChar * chars, int numChars, quint32 * glyphIndexes, int * numGlyphs); fn C_ZNK8QRawFont20glyphIndexesForCharsEPK5QChariPjPi(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_int, arg2: *mut c_uint, arg3: *mut c_int) -> c_char; // proto: QString QRawFont::styleName(); fn C_ZNK8QRawFont9styleNameEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: qreal QRawFont::underlinePosition(); fn C_ZNK8QRawFont17underlinePositionEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: qreal QRawFont::unitsPerEm(); fn C_ZNK8QRawFont10unitsPerEmEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: bool QRawFont::supportsCharacter(QChar character); fn C_ZNK8QRawFont17supportsCharacterE5QChar(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QString QRawFont::familyName(); fn C_ZNK8QRawFont10familyNameEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QRawFont::advancesForGlyphIndexes(const quint32 * glyphIndexes, QPointF * advances, int numGlyphs); fn C_ZNK8QRawFont23advancesForGlyphIndexesEPKjP7QPointFi(qthis: u64 /* *mut c_void*/, arg0: *mut c_uint, arg1: *mut c_void, arg2: c_int) -> c_char; // proto: qreal QRawFont::pixelSize(); fn C_ZNK8QRawFont9pixelSizeEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: int QRawFont::weight(); fn C_ZNK8QRawFont6weightEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QRawFont::QRawFont(const QRawFont & other); fn C_ZN8QRawFontC2ERKS_(arg0: *mut c_void) -> u64; // proto: qreal QRawFont::xHeight(); fn C_ZNK8QRawFont7xHeightEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QRawFont::~QRawFont(); fn C_ZN8QRawFontD2Ev(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QRawFont::pathForGlyph(quint32 glyphIndex); fn C_ZNK8QRawFont12pathForGlyphEj(qthis: u64 /* *mut c_void*/, arg0: c_uint) -> *mut c_void; // proto: QByteArray QRawFont::fontTable(const char * tagName); fn C_ZNK8QRawFont9fontTableEPKc(qthis: u64 /* *mut c_void*/, arg0: *mut c_char) -> *mut c_void; // proto: qreal QRawFont::maxCharWidth(); fn C_ZNK8QRawFont12maxCharWidthEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: QVector<quint32> QRawFont::glyphIndexesForString(const QString & text); fn C_ZNK8QRawFont21glyphIndexesForStringERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; } // <= ext block end // body block begin => // class sizeof(QRawFont)=1 #[derive(Default)] pub struct QRawFont { // qbase: None, pub qclsinst: u64 /* *mut c_void*/, } impl /*struct*/ QRawFont { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QRawFont { return QRawFont{qclsinst: qthis, ..Default::default()}; } } // proto: qreal QRawFont::averageCharWidth(); impl /*struct*/ QRawFont { pub fn averageCharWidth<RetType, T: QRawFont_averageCharWidth<RetType>>(& self, overload_args: T) -> RetType { return overload_args.averageCharWidth(self); // return 1; } } pub trait QRawFont_averageCharWidth<RetType> { fn averageCharWidth(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::averageCharWidth(); impl<'a> /*trait*/ QRawFont_averageCharWidth<f64> for () { fn averageCharWidth(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont16averageCharWidthEv()}; let mut ret = unsafe {C_ZNK8QRawFont16averageCharWidthEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: qreal QRawFont::ascent(); impl /*struct*/ QRawFont { pub fn ascent<RetType, T: QRawFont_ascent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.ascent(self); // return 1; } } pub trait QRawFont_ascent<RetType> { fn ascent(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::ascent(); impl<'a> /*trait*/ QRawFont_ascent<f64> for () { fn ascent(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont6ascentEv()}; let mut ret = unsafe {C_ZNK8QRawFont6ascentEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: qreal QRawFont::leading(); impl /*struct*/ QRawFont { pub fn leading<RetType, T: QRawFont_leading<RetType>>(& self, overload_args: T) -> RetType { return overload_args.leading(self); // return 1; } } pub trait QRawFont_leading<RetType> { fn leading(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::leading(); impl<'a> /*trait*/ QRawFont_leading<f64> for () { fn leading(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont7leadingEv()}; let mut ret = unsafe {C_ZNK8QRawFont7leadingEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: qreal QRawFont::lineThickness(); impl /*struct*/ QRawFont { pub fn lineThickness<RetType, T: QRawFont_lineThickness<RetType>>(& self, overload_args: T) -> RetType { return overload_args.lineThickness(self); // return 1; } } pub trait QRawFont_lineThickness<RetType> { fn lineThickness(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::lineThickness(); impl<'a> /*trait*/ QRawFont_lineThickness<f64> for () { fn lineThickness(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont13lineThicknessEv()}; let mut ret = unsafe {C_ZNK8QRawFont13lineThicknessEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: bool QRawFont::isValid(); impl /*struct*/ QRawFont { pub fn isValid<RetType, T: QRawFont_isValid<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isValid(self); // return 1; } } pub trait QRawFont_isValid<RetType> { fn isValid(self , rsthis: & QRawFont) -> RetType; } // proto: bool QRawFont::isValid(); impl<'a> /*trait*/ QRawFont_isValid<i8> for () { fn isValid(self , rsthis: & QRawFont) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont7isValidEv()}; let mut ret = unsafe {C_ZNK8QRawFont7isValidEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QRectF QRawFont::boundingRect(quint32 glyphIndex); impl /*struct*/ QRawFont { pub fn boundingRect<RetType, T: QRawFont_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QRawFont_boundingRect<RetType> { fn boundingRect(self , rsthis: & QRawFont) -> RetType; } // proto: QRectF QRawFont::boundingRect(quint32 glyphIndex); impl<'a> /*trait*/ QRawFont_boundingRect<QRectF> for (u32) { fn boundingRect(self , rsthis: & QRawFont) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont12boundingRectEj()}; let arg0 = self as c_uint; let mut ret = unsafe {C_ZNK8QRawFont12boundingRectEj(rsthis.qclsinst, arg0)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QRawFont::supportsCharacter(uint ucs4); impl /*struct*/ QRawFont { pub fn supportsCharacter<RetType, T: QRawFont_supportsCharacter<RetType>>(& self, overload_args: T) -> RetType { return overload_args.supportsCharacter(self); // return 1; } } pub trait QRawFont_supportsCharacter<RetType> { fn supportsCharacter(self , rsthis: & QRawFont) -> RetType; } // proto: bool QRawFont::supportsCharacter(uint ucs4); impl<'a> /*trait*/ QRawFont_supportsCharacter<i8> for (u32) { fn supportsCharacter(self , rsthis: & QRawFont) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont17supportsCharacterEj()}; let arg0 = self as c_uint; let mut ret = unsafe {C_ZNK8QRawFont17supportsCharacterEj(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QRawFont::swap(QRawFont & other); impl /*struct*/ QRawFont { pub fn swap<RetType, T: QRawFont_swap<RetType>>(& self, overload_args: T) -> RetType { return overload_args.swap(self); // return 1; } } pub trait QRawFont_swap<RetType> { fn swap(self , rsthis: & QRawFont) -> RetType; } // proto: void QRawFont::swap(QRawFont & other); impl<'a> /*trait*/ QRawFont_swap<()> for (&'a QRawFont) { fn swap(self , rsthis: & QRawFont) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN8QRawFont4swapERS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN8QRawFont4swapERS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: qreal QRawFont::descent(); impl /*struct*/ QRawFont { pub fn descent<RetType, T: QRawFont_descent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.descent(self); // return 1; } } pub trait QRawFont_descent<RetType> { fn descent(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::descent(); impl<'a> /*trait*/ QRawFont_descent<f64> for () { fn descent(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont7descentEv()}; let mut ret = unsafe {C_ZNK8QRawFont7descentEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QRawFont::QRawFont(); impl /*struct*/ QRawFont { pub fn new<T: QRawFont_new>(value: T) -> QRawFont { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QRawFont_new { fn new(self) -> QRawFont; } // proto: void QRawFont::QRawFont(); impl<'a> /*trait*/ QRawFont_new for () { fn new(self) -> QRawFont { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN8QRawFontC2Ev()}; let ctysz: c_int = unsafe{QRawFont_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let qthis: u64 = unsafe {C_ZN8QRawFontC2Ev()}; let rsthis = QRawFont{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QRawFont::setPixelSize(qreal pixelSize); impl /*struct*/ QRawFont { pub fn setPixelSize<RetType, T: QRawFont_setPixelSize<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPixelSize(self); // return 1; } } pub trait QRawFont_setPixelSize<RetType> { fn setPixelSize(self , rsthis: & QRawFont) -> RetType; } // proto: void QRawFont::setPixelSize(qreal pixelSize); impl<'a> /*trait*/ QRawFont_setPixelSize<()> for (f64) { fn setPixelSize(self , rsthis: & QRawFont) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN8QRawFont12setPixelSizeEd()}; let arg0 = self as c_double; unsafe {C_ZN8QRawFont12setPixelSizeEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: bool QRawFont::glyphIndexesForChars(const QChar * chars, int numChars, quint32 * glyphIndexes, int * numGlyphs); impl /*struct*/ QRawFont { pub fn glyphIndexesForChars<RetType, T: QRawFont_glyphIndexesForChars<RetType>>(& self, overload_args: T) -> RetType { return overload_args.glyphIndexesForChars(self); // return 1; } } pub trait QRawFont_glyphIndexesForChars<RetType> { fn glyphIndexesForChars(self , rsthis: & QRawFont) -> RetType; } // proto: bool QRawFont::glyphIndexesForChars(const QChar * chars, int numChars, quint32 * glyphIndexes, int * numGlyphs); impl<'a> /*trait*/ QRawFont_glyphIndexesForChars<i8> for (&'a QChar, i32, &'a mut Vec<u32>, &'a mut Vec<i32>) { fn glyphIndexesForChars(self , rsthis: & QRawFont) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont20glyphIndexesForCharsEPK5QChariPjPi()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_int; let arg2 = self.2.as_ptr() as *mut c_uint; let arg3 = self.3.as_ptr() as *mut c_int; let mut ret = unsafe {C_ZNK8QRawFont20glyphIndexesForCharsEPK5QChariPjPi(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; return ret as i8; // 1 // return 1; } } // proto: QString QRawFont::styleName(); impl /*struct*/ QRawFont { pub fn styleName<RetType, T: QRawFont_styleName<RetType>>(& self, overload_args: T) -> RetType { return overload_args.styleName(self); // return 1; } } pub trait QRawFont_styleName<RetType> { fn styleName(self , rsthis: & QRawFont) -> RetType; } // proto: QString QRawFont::styleName(); impl<'a> /*trait*/ QRawFont_styleName<QString> for () { fn styleName(self , rsthis: & QRawFont) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont9styleNameEv()}; let mut ret = unsafe {C_ZNK8QRawFont9styleNameEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: qreal QRawFont::underlinePosition(); impl /*struct*/ QRawFont { pub fn underlinePosition<RetType, T: QRawFont_underlinePosition<RetType>>(& self, overload_args: T) -> RetType { return overload_args.underlinePosition(self); // return 1; } } pub trait QRawFont_underlinePosition<RetType> { fn underlinePosition(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::underlinePosition(); impl<'a> /*trait*/ QRawFont_underlinePosition<f64> for () { fn underlinePosition(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont17underlinePositionEv()}; let mut ret = unsafe {C_ZNK8QRawFont17underlinePositionEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: qreal QRawFont::unitsPerEm(); impl /*struct*/ QRawFont { pub fn unitsPerEm<RetType, T: QRawFont_unitsPerEm<RetType>>(& self, overload_args: T) -> RetType { return overload_args.unitsPerEm(self); // return 1; } } pub trait QRawFont_unitsPerEm<RetType> { fn unitsPerEm(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::unitsPerEm(); impl<'a> /*trait*/ QRawFont_unitsPerEm<f64> for () { fn unitsPerEm(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont10unitsPerEmEv()}; let mut ret = unsafe {C_ZNK8QRawFont10unitsPerEmEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: bool QRawFont::supportsCharacter(QChar character); impl<'a> /*trait*/ QRawFont_supportsCharacter<i8> for (QChar) { fn supportsCharacter(self , rsthis: & QRawFont) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont17supportsCharacterE5QChar()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK8QRawFont17supportsCharacterE5QChar(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QString QRawFont::familyName(); impl /*struct*/ QRawFont { pub fn familyName<RetType, T: QRawFont_familyName<RetType>>(& self, overload_args: T) -> RetType { return overload_args.familyName(self); // return 1; } } pub trait QRawFont_familyName<RetType> { fn familyName(self , rsthis: & QRawFont) -> RetType; } // proto: QString QRawFont::familyName(); impl<'a> /*trait*/ QRawFont_familyName<QString> for () { fn familyName(self , rsthis: & QRawFont) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont10familyNameEv()}; let mut ret = unsafe {C_ZNK8QRawFont10familyNameEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QRawFont::advancesForGlyphIndexes(const quint32 * glyphIndexes, QPointF * advances, int numGlyphs); impl /*struct*/ QRawFont { pub fn advancesForGlyphIndexes<RetType, T: QRawFont_advancesForGlyphIndexes<RetType>>(& self, overload_args: T) -> RetType { return overload_args.advancesForGlyphIndexes(self); // return 1; } } pub trait QRawFont_advancesForGlyphIndexes<RetType> { fn advancesForGlyphIndexes(self , rsthis: & QRawFont) -> RetType; } // proto: bool QRawFont::advancesForGlyphIndexes(const quint32 * glyphIndexes, QPointF * advances, int numGlyphs); impl<'a> /*trait*/ QRawFont_advancesForGlyphIndexes<i8> for (&'a Vec<u32>, &'a QPointF, i32) { fn advancesForGlyphIndexes(self , rsthis: & QRawFont) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont23advancesForGlyphIndexesEPKjP7QPointFi()}; let arg0 = self.0.as_ptr() as *mut c_uint; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = self.2 as c_int; let mut ret = unsafe {C_ZNK8QRawFont23advancesForGlyphIndexesEPKjP7QPointFi(rsthis.qclsinst, arg0, arg1, arg2)}; return ret as i8; // 1 // return 1; } } // proto: qreal QRawFont::pixelSize(); impl /*struct*/ QRawFont { pub fn pixelSize<RetType, T: QRawFont_pixelSize<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pixelSize(self); // return 1; } } pub trait QRawFont_pixelSize<RetType> { fn pixelSize(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::pixelSize(); impl<'a> /*trait*/ QRawFont_pixelSize<f64> for () { fn pixelSize(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont9pixelSizeEv()}; let mut ret = unsafe {C_ZNK8QRawFont9pixelSizeEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: int QRawFont::weight(); impl /*struct*/ QRawFont { pub fn weight<RetType, T: QRawFont_weight<RetType>>(& self, overload_args: T) -> RetType { return overload_args.weight(self); // return 1; } } pub trait QRawFont_weight<RetType> { fn weight(self , rsthis: & QRawFont) -> RetType; } // proto: int QRawFont::weight(); impl<'a> /*trait*/ QRawFont_weight<i32> for () { fn weight(self , rsthis: & QRawFont) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont6weightEv()}; let mut ret = unsafe {C_ZNK8QRawFont6weightEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QRawFont::QRawFont(const QRawFont & other); impl<'a> /*trait*/ QRawFont_new for (&'a QRawFont) { fn new(self) -> QRawFont { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN8QRawFontC2ERKS_()}; let ctysz: c_int = unsafe{QRawFont_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.qclsinst as *mut c_void; let qthis: u64 = unsafe {C_ZN8QRawFontC2ERKS_(arg0)}; let rsthis = QRawFont{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: qreal QRawFont::xHeight(); impl /*struct*/ QRawFont { pub fn xHeight<RetType, T: QRawFont_xHeight<RetType>>(& self, overload_args: T) -> RetType { return overload_args.xHeight(self); // return 1; } } pub trait QRawFont_xHeight<RetType> { fn xHeight(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::xHeight(); impl<'a> /*trait*/ QRawFont_xHeight<f64> for () { fn xHeight(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont7xHeightEv()}; let mut ret = unsafe {C_ZNK8QRawFont7xHeightEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QRawFont::~QRawFont(); impl /*struct*/ QRawFont { pub fn free<RetType, T: QRawFont_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QRawFont_free<RetType> { fn free(self , rsthis: & QRawFont) -> RetType; } // proto: void QRawFont::~QRawFont(); impl<'a> /*trait*/ QRawFont_free<()> for () { fn free(self , rsthis: & QRawFont) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN8QRawFontD2Ev()}; unsafe {C_ZN8QRawFontD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QRawFont::pathForGlyph(quint32 glyphIndex); impl /*struct*/ QRawFont { pub fn pathForGlyph<RetType, T: QRawFont_pathForGlyph<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pathForGlyph(self); // return 1; } } pub trait QRawFont_pathForGlyph<RetType> { fn pathForGlyph(self , rsthis: & QRawFont) -> RetType; } // proto: QPainterPath QRawFont::pathForGlyph(quint32 glyphIndex); impl<'a> /*trait*/ QRawFont_pathForGlyph<QPainterPath> for (u32) { fn pathForGlyph(self , rsthis: & QRawFont) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont12pathForGlyphEj()}; let arg0 = self as c_uint; let mut ret = unsafe {C_ZNK8QRawFont12pathForGlyphEj(rsthis.qclsinst, arg0)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QByteArray QRawFont::fontTable(const char * tagName); impl /*struct*/ QRawFont { pub fn fontTable<RetType, T: QRawFont_fontTable<RetType>>(& self, overload_args: T) -> RetType { return overload_args.fontTable(self); // return 1; } } pub trait QRawFont_fontTable<RetType> { fn fontTable(self , rsthis: & QRawFont) -> RetType; } // proto: QByteArray QRawFont::fontTable(const char * tagName); impl<'a> /*trait*/ QRawFont_fontTable<QByteArray> for (&'a String) { fn fontTable(self , rsthis: & QRawFont) -> QByteArray { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont9fontTableEPKc()}; let arg0 = self.as_ptr() as *mut c_char; let mut ret = unsafe {C_ZNK8QRawFont9fontTableEPKc(rsthis.qclsinst, arg0)}; let mut ret1 = QByteArray::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: qreal QRawFont::maxCharWidth(); impl /*struct*/ QRawFont { pub fn maxCharWidth<RetType, T: QRawFont_maxCharWidth<RetType>>(& self, overload_args: T) -> RetType { return overload_args.maxCharWidth(self); // return 1; } } pub trait QRawFont_maxCharWidth<RetType> { fn maxCharWidth(self , rsthis: & QRawFont) -> RetType; } // proto: qreal QRawFont::maxCharWidth(); impl<'a> /*trait*/ QRawFont_maxCharWidth<f64> for () { fn maxCharWidth(self , rsthis: & QRawFont) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont12maxCharWidthEv()}; let mut ret = unsafe {C_ZNK8QRawFont12maxCharWidthEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: QVector<quint32> QRawFont::glyphIndexesForString(const QString & text); impl /*struct*/ QRawFont { pub fn glyphIndexesForString<RetType, T: QRawFont_glyphIndexesForString<RetType>>(& self, overload_args: T) -> RetType { return overload_args.glyphIndexesForString(self); // return 1; } } pub trait QRawFont_glyphIndexesForString<RetType> { fn glyphIndexesForString(self , rsthis: & QRawFont) -> RetType; } // proto: QVector<quint32> QRawFont::glyphIndexesForString(const QString & text); impl<'a> /*trait*/ QRawFont_glyphIndexesForString<u64> for (&'a QString) { fn glyphIndexesForString(self , rsthis: & QRawFont) -> u64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK8QRawFont21glyphIndexesForStringERK7QString()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK8QRawFont21glyphIndexesForStringERK7QString(rsthis.qclsinst, arg0)}; return ret as u64; // 5 // return 1; } } // <= body block end
/* Input: a vector of points (x, y) output: a vector of lines (xbeg, ybeg, xend, yend) */ pub fn run(input:&vec<(f64, f64)>, output:&mut vec<Line>) { }
use crate::backend::c; use bitflags::bitflags; bitflags! { /// `MS_*` constants for use with [`mount`]. /// /// [`mount`]: crate::mount::mount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MountFlags: c::c_uint { /// `MS_BIND` const BIND = linux_raw_sys::general::MS_BIND; /// `MS_DIRSYNC` const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC; /// `MS_LAZYTIME` const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME; /// `MS_MANDLOCK` #[doc(alias = "MANDLOCK")] const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK; /// `MS_NOATIME` const NOATIME = linux_raw_sys::general::MS_NOATIME; /// `MS_NODEV` const NODEV = linux_raw_sys::general::MS_NODEV; /// `MS_NODIRATIME` const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME; /// `MS_NOEXEC` const NOEXEC = linux_raw_sys::general::MS_NOEXEC; /// `MS_NOSUID` const NOSUID = linux_raw_sys::general::MS_NOSUID; /// `MS_RDONLY` const RDONLY = linux_raw_sys::general::MS_RDONLY; /// `MS_REC` const REC = linux_raw_sys::general::MS_REC; /// `MS_RELATIME` const RELATIME = linux_raw_sys::general::MS_RELATIME; /// `MS_SILENT` const SILENT = linux_raw_sys::general::MS_SILENT; /// `MS_STRICTATIME` const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME; /// `MS_SYNCHRONOUS` const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS; /// `MS_NOSYMFOLLOW` const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW; } } bitflags! { /// `MNT_*` constants for use with [`unmount`]. /// /// [`unmount`]: crate::mount::unmount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct UnmountFlags: c::c_uint { /// `MNT_FORCE` const FORCE = linux_raw_sys::general::MNT_FORCE; /// `MNT_DETACH` const DETACH = linux_raw_sys::general::MNT_DETACH; /// `MNT_EXPIRE` const EXPIRE = linux_raw_sys::general::MNT_EXPIRE; /// `UMOUNT_NOFOLLOW` const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW; } } #[cfg(feature = "mount")] bitflags! { /// `FSOPEN_*` constants for use with [`fsopen`]. /// /// [`fsopen`]: crate::mount::fsopen #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct FsOpenFlags: c::c_uint { /// `FSOPEN_CLOEXEC` const FSOPEN_CLOEXEC = linux_raw_sys::general::FSOPEN_CLOEXEC; } } #[cfg(feature = "mount")] bitflags! { /// `FSMOUNT_*` constants for use with [`fsmount`]. /// /// [`fsmount`]: crate::mount::fsmount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct FsMountFlags: c::c_uint { /// `FSMOUNT_CLOEXEC` const FSMOUNT_CLOEXEC = linux_raw_sys::general::FSMOUNT_CLOEXEC; } } /// `FSCONFIG_*` constants for use with the `fsconfig` syscall. #[cfg(feature = "mount")] #[derive(Debug, Copy, Clone, Eq, PartialEq)] #[repr(u32)] pub(crate) enum FsConfigCmd { /// `FSCONFIG_SET_FLAG` SetFlag = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FLAG as u32, /// `FSCONFIG_SET_STRING` SetString = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_STRING as u32, /// `FSCONFIG_SET_BINARY` SetBinary = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_BINARY as u32, /// `FSCONFIG_SET_PATH` SetPath = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH as u32, /// `FSCONFIG_SET_PATH_EMPTY` SetPathEmpty = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH_EMPTY as u32, /// `FSCONFIG_SET_FD` SetFd = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FD as u32, /// `FSCONFIG_CMD_CREATE` Create = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_CREATE as u32, /// `FSCONFIG_CMD_RECONFIGURE` Reconfigure = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_RECONFIGURE as u32, } #[cfg(feature = "mount")] bitflags! { /// `MOUNT_ATTR_*` constants for use with [`fsmount`]. /// /// [`fsmount`]: crate::mount::fsmount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MountAttrFlags: c::c_uint { /// `MOUNT_ATTR_RDONLY` const MOUNT_ATTR_RDONLY = linux_raw_sys::general::MOUNT_ATTR_RDONLY; /// `MOUNT_ATTR_NOSUID` const MOUNT_ATTR_NOSUID = linux_raw_sys::general::MOUNT_ATTR_NOSUID; /// `MOUNT_ATTR_NODEV` const MOUNT_ATTR_NODEV = linux_raw_sys::general::MOUNT_ATTR_NODEV; /// `MOUNT_ATTR_NOEXEC` const MOUNT_ATTR_NOEXEC = linux_raw_sys::general::MOUNT_ATTR_NOEXEC; /// `MOUNT_ATTR__ATIME` const MOUNT_ATTR__ATIME = linux_raw_sys::general::MOUNT_ATTR__ATIME; /// `MOUNT_ATTR_RELATIME` const MOUNT_ATTR_RELATIME = linux_raw_sys::general::MOUNT_ATTR_RELATIME; /// `MOUNT_ATTR_NOATIME` const MOUNT_ATTR_NOATIME = linux_raw_sys::general::MOUNT_ATTR_NOATIME; /// `MOUNT_ATTR_STRICTATIME` const MOUNT_ATTR_STRICTATIME = linux_raw_sys::general::MOUNT_ATTR_STRICTATIME; /// `MOUNT_ATTR_NODIRATIME` const MOUNT_ATTR_NODIRATIME = linux_raw_sys::general::MOUNT_ATTR_NODIRATIME; /// `MOUNT_ATTR_NOUSER` const MOUNT_ATTR_IDMAP = linux_raw_sys::general::MOUNT_ATTR_IDMAP; /// `MOUNT_ATTR__ATIME_FLAGS` const MOUNT_ATTR_NOSYMFOLLOW = linux_raw_sys::general::MOUNT_ATTR_NOSYMFOLLOW; /// `MOUNT_ATTR__ATIME_FLAGS` const MOUNT_ATTR_SIZE_VER0 = linux_raw_sys::general::MOUNT_ATTR_SIZE_VER0; } } #[cfg(feature = "mount")] bitflags! { /// `MOVE_MOUNT_*` constants for use with [`move_mount`]. /// /// [`move_mount`]: crate::mount::move_mount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MoveMountFlags: c::c_uint { /// `MOVE_MOUNT_F_EMPTY_PATH` const MOVE_MOUNT_F_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_F_SYMLINKS; /// `MOVE_MOUNT_F_AUTOMOUNTS` const MOVE_MOUNT_F_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_F_AUTOMOUNTS; /// `MOVE_MOUNT_F_EMPTY_PATH` const MOVE_MOUNT_F_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_F_EMPTY_PATH; /// `MOVE_MOUNT_T_SYMLINKS` const MOVE_MOUNT_T_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_T_SYMLINKS; /// `MOVE_MOUNT_T_AUTOMOUNTS` const MOVE_MOUNT_T_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_T_AUTOMOUNTS; /// `MOVE_MOUNT_T_EMPTY_PATH` const MOVE_MOUNT_T_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_T_EMPTY_PATH; /// `MOVE_MOUNT__MASK` const MOVE_MOUNT_SET_GROUP = linux_raw_sys::general::MOVE_MOUNT_SET_GROUP; // TODO: add when linux 6.5 is released // /// `MOVE_MOUNT_BENEATH` // const MOVE_MOUNT_BENEATH = linux_raw_sys::general::MOVE_MOUNT_BENEATH; /// `MOVE_MOUNT__MASK` const MOVE_MOUNT__MASK = linux_raw_sys::general::MOVE_MOUNT__MASK; } } #[cfg(feature = "mount")] bitflags! { /// `OPENTREE_*` constants for use with [`open_tree`]. /// /// [`open_tree`]: crate::mount::open_tree #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct OpenTreeFlags: c::c_uint { /// `OPENTREE_CLONE` const OPEN_TREE_CLONE = linux_raw_sys::general::OPEN_TREE_CLONE; /// `OPENTREE_CLOEXEC` const OPEN_TREE_CLOEXEC = linux_raw_sys::general::OPEN_TREE_CLOEXEC; /// `AT_EMPTY_PATH` const AT_EMPTY_PATH = linux_raw_sys::general::AT_EMPTY_PATH; /// `AT_NO_AUTOMOUNT` const AT_NO_AUTOMOUNT = linux_raw_sys::general::AT_NO_AUTOMOUNT; /// `AT_RECURSIVE` const AT_RECURSIVE = linux_raw_sys::general::AT_RECURSIVE; /// `AT_SYMLINK_NOFOLLOW` const AT_SYMLINK_NOFOLLOW = linux_raw_sys::general::AT_SYMLINK_NOFOLLOW; } } #[cfg(feature = "mount")] bitflags! { /// `FSPICK_*` constants for use with [`fspick`]. /// /// [`fspick`]: crate::mount::fspick #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct FsPickFlags: c::c_uint { /// `FSPICK_CLOEXEC` const FSPICK_CLOEXEC = linux_raw_sys::general::FSPICK_CLOEXEC; /// `FSPICK_SYMLINK_NOFOLLOW` const FSPICK_SYMLINK_NOFOLLOW = linux_raw_sys::general::FSPICK_SYMLINK_NOFOLLOW; /// `FSPICK_NO_AUTOMOUNT` const FSPICK_NO_AUTOMOUNT = linux_raw_sys::general::FSPICK_NO_AUTOMOUNT; /// `FSPICK_EMPTY_PATH` const FSPICK_EMPTY_PATH = linux_raw_sys::general::FSPICK_EMPTY_PATH; } } bitflags! { /// `MS_*` constants for use with [`change_mount`]. /// /// [`change_mount`]: crate::mount::change_mount #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MountPropagationFlags: c::c_uint { /// `MS_SILENT` const SILENT = linux_raw_sys::general::MS_SILENT; /// `MS_SHARED` const SHARED = linux_raw_sys::general::MS_SHARED; /// `MS_PRIVATE` const PRIVATE = linux_raw_sys::general::MS_PRIVATE; /// `MS_SLAVE` const SLAVE = linux_raw_sys::general::MS_SLAVE; /// `MS_UNBINDABLE` const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE; /// `MS_REC` const REC = linux_raw_sys::general::MS_REC; } } bitflags! { #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub(crate) struct InternalMountFlags: c::c_uint { const REMOUNT = linux_raw_sys::general::MS_REMOUNT; const MOVE = linux_raw_sys::general::MS_MOVE; } } #[repr(transparent)] pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);
use std::io; use std::default::Default; use crate::{Battery}; use crate::platform::traits::{BatteryManager}; use super::SysFsIterator; static SYSFS_ROOT: &'static str = "/sys/class/power_supply"; #[derive(Debug)] pub struct SysFsManager; impl SysFsManager { pub fn iter(&self) -> SysFsIterator { SysFsIterator::from_path(SYSFS_ROOT) } } impl BatteryManager for SysFsManager { fn refresh(&mut self, battery: &mut Battery) -> io::Result<()> { battery.get_mut_ref().refresh() } } impl Default for SysFsManager { fn default() -> SysFsManager { SysFsManager{} } }
use std::io::Read; use std::fs::File; fn parse_file(filename: &String, out: &mut Vec<String>) { let mut content: String = String::new(); let mut file = File::open(filename).unwrap(); file.read_to_string(&mut content).unwrap(); let iter = content .lines() .map(|x| x.to_string()); out.extend(iter); } fn count_trees(lines: &Vec<String>, x_steps: usize, y_steps: usize) -> usize { let mut n_trees = 0; let mut x = 0; let mut y = 0; let tree: String = "#".to_string(); let width = lines[0].len(); while y < lines.len() - 1 { y += y_steps; x = (x + x_steps) % width; let s: String = lines[y][x .. x + 1] .chars() .as_str() .to_string(); if s == tree { n_trees += 1; } } return n_trees; } pub fn solve_day3(filename: &String) { /* PART 1 */ let mut lines = Vec::<String>::new(); parse_file(filename, &mut lines); let n_trees = count_trees(&lines, 3, 1); println!("Got {} hits!", n_trees); /* PART 2 */ let x = count_trees(&lines, 1, 1) * count_trees(&lines, 3, 1) * count_trees(&lines, 5, 1) * count_trees(&lines, 7, 1) * count_trees(&lines, 1, 2); println!("Product is {}", x); }
//use failure_derive::*; -- using thiserror insted use thiserror::*; #[derive(Error, Debug)] pub enum BlobError { #[error("No Room")] NoRoom, #[error("Too Big")] TooBig(u64), #[error("Item Not Fount")] NotFound, #[error("{}", 0)] Bincode(bincode::Error), #[error("{}", 0)] IO(std::io::Error), #[error("{}", 0)] Other(anyhow::Error), } impl From<anyhow::Error> for BlobError { fn from(fe: anyhow::Error) -> Self { BlobError::Other(fe) } } impl From<bincode::Error> for BlobError { fn from(fe: bincode::Error) -> Self { BlobError::Bincode(fe.into()) } } impl From<std::io::Error> for BlobError { fn from(fe: std::io::Error) -> Self { BlobError::IO(fe.into()) } }
//! Partial assignment and backtracking. use partial_ref::{partial, PartialRef}; use varisat_formula::{lit::LitIdx, Lit, Var}; use crate::{ context::{parts::*, Context}, decision::make_available, }; use super::Reason; /// Current partial assignment. #[derive(Default)] pub struct Assignment { assignment: Vec<Option<bool>>, last_value: Vec<bool>, } /// This compares two `Option<bool>` values as bytes. Workaround for bad code generation. pub fn fast_option_eq(a: Option<bool>, b: Option<bool>) -> bool { unsafe { std::mem::transmute::<_, u8>(a) == std::mem::transmute::<_, u8>(b) } } impl Assignment { /// Update structures for a new variable count. pub fn set_var_count(&mut self, count: usize) { self.assignment.resize(count, None); self.last_value.resize(count, false); } /// Current partial assignment as slice. pub fn assignment(&self) -> &[Option<bool>] { &self.assignment } /// Value assigned to a variable. pub fn var_value(&self, var: Var) -> Option<bool> { self.assignment[var.index()] } /// Value last assigned to a variable. /// /// If the variable is currently assigned this returns the previously assigned value. If the /// variable was never assigned this returns false. pub fn last_var_value(&self, var: Var) -> bool { self.last_value[var.index()] } /// Value assigned to a literal. pub fn lit_value(&self, lit: Lit) -> Option<bool> { self.assignment[lit.index()].map(|b| b ^ lit.is_negative()) } pub fn lit_is_true(&self, lit: Lit) -> bool { fast_option_eq(self.assignment[lit.index()], Some(lit.is_positive())) } pub fn lit_is_false(&self, lit: Lit) -> bool { fast_option_eq(self.assignment[lit.index()], Some(lit.is_negative())) } pub fn lit_is_unk(&self, lit: Lit) -> bool { fast_option_eq(self.assignment[lit.index()], None) } pub fn assign_lit(&mut self, lit: Lit) { self.assignment[lit.index()] = lit.is_positive().into() } pub fn unassign_var(&mut self, var: Var) { self.assignment[var.index()] = None; } /// Set the assigned/unassigned value of a variable. pub fn set_var(&mut self, var: Var, assignment: Option<bool>) { self.assignment[var.index()] = assignment; } } /// Decision and propagation history. #[derive(Default)] pub struct Trail { /// Stack of all propagated and all enqueued assignments trail: Vec<Lit>, /// Next assignment in trail to propagate queue_head_pos: usize, /// Decision levels as trail indices. decisions: Vec<LitIdx>, /// Number of unit clauses removed from the trail. units_removed: usize, } impl Trail { /// Return the next assigned literal to propagate. pub fn queue_head(&self) -> Option<Lit> { self.trail.get(self.queue_head_pos).cloned() } /// Return the next assigned literal to propagate and remove it from the queue. pub fn pop_queue(&mut self) -> Option<Lit> { let head = self.queue_head(); if head.is_some() { self.queue_head_pos += 1; } head } /// Re-enqueue all assigned literals. pub fn reset_queue(&mut self) { self.queue_head_pos = 0; } /// Assigned literals in assignment order. pub fn trail(&self) -> &[Lit] { &self.trail } /// Clear the trail. /// /// This simply removes all entries without performing any backtracking. Can only be called with /// no active decisions. pub fn clear(&mut self) { assert!(self.decisions.is_empty()); self.units_removed += self.trail.len(); self.trail.clear(); self.queue_head_pos = 0; } /// Start a new decision level. /// /// Does not enqueue the decision itself. pub fn new_decision_level(&mut self) { self.decisions.push(self.trail.len() as LitIdx) } /// Current decision level. pub fn current_level(&self) -> usize { self.decisions.len() } /// The number of assignments at level 0. pub fn top_level_assignment_count(&self) -> usize { self.decisions .get(0) .map(|&len| len as usize) .unwrap_or(self.trail.len()) + self.units_removed } /// Whether all assignments are processed. pub fn fully_propagated(&self) -> bool { self.queue_head_pos == self.trail.len() } } /// Enqueues the assignment of true to a literal. /// /// This updates the assignment and trail, but does not perform any propagation. The literal has to /// be unassigned when calling this. pub fn enqueue_assignment( mut ctx: partial!(Context, mut AssignmentP, mut ImplGraphP, mut TrailP), lit: Lit, reason: Reason, ) { let assignment = ctx.part_mut(AssignmentP); debug_assert!(assignment.lit_value(lit) == None); assignment.assign_lit(lit); let (trail, mut ctx) = ctx.split_part_mut(TrailP); trail.trail.push(lit); let node = &mut ctx.part_mut(ImplGraphP).nodes[lit.index()]; node.reason = reason; node.level = trail.decisions.len() as LitIdx; node.depth = trail.trail.len() as LitIdx; } /// Undo all assignments in decision levels deeper than the given level. pub fn backtrack( mut ctx: partial!(Context, mut AssignmentP, mut TrailP, mut VsidsP), level: usize, ) { let (assignment, mut ctx) = ctx.split_part_mut(AssignmentP); let (trail, mut ctx) = ctx.split_part_mut(TrailP); // level can actually be greater than the current level. This happens when restart is called // after a conflict backtracked into the assumptions, but before any assumption was reenqueued. // TODO should we update assumption_levels on backtracking instead of allowing this here? if level >= trail.decisions.len() { return; } let new_trail_len = trail.decisions[level] as usize; trail.queue_head_pos = new_trail_len; trail.decisions.truncate(level); let trail_end = &trail.trail[new_trail_len..]; for &lit in trail_end { make_available(ctx.borrow(), lit.var()); let var_assignment = &mut assignment.assignment[lit.index()]; assignment.last_value[lit.index()] = *var_assignment == Some(true); *var_assignment = None; } trail.trail.truncate(new_trail_len); } /// Undo all decisions and assumptions. pub fn full_restart( mut ctx: partial!( Context, mut AssignmentP, mut AssumptionsP, mut TrailP, mut VsidsP, ), ) { ctx.part_mut(AssumptionsP).full_restart(); backtrack(ctx.borrow(), 0); } /// Undo all decisions. pub fn restart( mut ctx: partial!( Context, mut AssignmentP, mut TrailP, mut VsidsP, AssumptionsP ), ) { let level = ctx.part(AssumptionsP).assumption_levels(); backtrack(ctx.borrow(), level); }
extern crate serde; mod test_utils; use flexi_logger::LoggerHandle; use hdbconnect_async::types::BLob; use hdbconnect_async::{Connection, HdbResult, HdbValue}; use log::{debug, info}; use rand::{thread_rng, RngCore}; use serde::{Deserialize, Serialize}; use serde_bytes::{ByteBuf, Bytes}; use sha2::{Digest, Sha256}; // cargo test test_032_blobs -- --nocapture #[tokio::test] async fn test_032_blobs() -> HdbResult<()> { let mut loghandle = test_utils::init_logger(); let start = std::time::Instant::now(); let mut connection = test_utils::get_authenticated_connection().await?; let (random_bytes, fingerprint) = get_random_bytes(); test_blobs( &mut loghandle, &mut connection, random_bytes.clone(), &fingerprint, ) .await?; test_streaming(&mut loghandle, &mut connection, random_bytes, &fingerprint).await?; test_utils::closing_info(connection, start).await } const SIZE: usize = 5 * 1024 * 1024; fn get_random_bytes() -> (Vec<u8>, Vec<u8>) { // create random byte data let mut raw_data = vec![0; SIZE]; raw_data.resize(SIZE, 0_u8); thread_rng().fill_bytes(&mut raw_data); assert_eq!(raw_data.len(), SIZE); let mut hasher = Sha256::default(); hasher.update(&raw_data); (raw_data, hasher.finalize().to_vec()) } async fn test_blobs( _loghandle: &mut LoggerHandle, connection: &mut Connection, random_bytes: Vec<u8>, fingerprint: &[u8], ) -> HdbResult<()> { info!("create a 5MB BLOB in the database, and read it in various ways"); connection.set_lob_read_length(1_000_000).await?; connection .multiple_statements_ignore_err(vec!["drop table TEST_BLOBS"]) .await; let stmts = vec![ "\ create table TEST_BLOBS \ (desc NVARCHAR(10) not null, bindata BLOB, bindata_NN BLOB NOT NULL)", ]; connection.multiple_statements(stmts).await?; #[derive(Serialize, Deserialize, Debug, PartialEq)] struct MyData { #[serde(rename = "DESC")] desc: String, #[serde(rename = "BL1")] bytes: ByteBuf, // Vec<u8>, #[serde(rename = "BL2")] o_bytes: Option<ByteBuf>, // Option<Vec<u8>>, #[serde(rename = "BL3")] bytes_nn: ByteBuf, // Vec<u8>, } // insert it into HANA let mut insert_stmt = connection .prepare("insert into TEST_BLOBS (desc, bindata, bindata_NN) values (?,?,?)") .await?; insert_stmt.add_batch(&("5MB", Bytes::new(&random_bytes), Bytes::new(&random_bytes)))?; insert_stmt.execute_batch().await?; assert_eq!( (random_bytes.len(), random_bytes.len()), connection .query("select length(BINDATA),length(BINDATA_NN) from TEST_BLOBS") .await? .try_into::<(usize, usize)>() .await?, "data length in database is not as expected" ); // and read it back let before = connection.get_call_count().await?; let query = "select desc, bindata as BL1, bindata as BL2 , bindata_NN as BL3 from TEST_BLOBS"; let resultset = connection.query(query).await?; let mydata: MyData = resultset.try_into().await?; info!( "reading 2x5MB BLOB with lob-read-length {} required {} roundtrips", connection.lob_read_length().await?, connection.get_call_count().await? - before ); // verify we get the same bytes back assert_eq!(SIZE, mydata.bytes.len()); let mut hasher = Sha256::default(); hasher.update(&mydata.bytes); assert_eq!(SIZE, mydata.bytes_nn.len()); let mut hasher = Sha256::default(); hasher.update(&mydata.bytes_nn); let fingerprint2 = hasher.finalize().to_vec(); assert_eq!(fingerprint, fingerprint2.as_slice()); let mut hasher = Sha256::default(); hasher.update(mydata.o_bytes.as_ref().unwrap()); let fingerprint2 = hasher.finalize().to_vec(); assert_eq!(fingerprint, fingerprint2.as_slice()); // try again with small lob-read-length connection.set_lob_read_length(10_000).await?; let before = connection.get_call_count().await?; let resultset = connection.query(query).await?; let second: MyData = resultset.try_into().await?; info!( "reading 2x5MB BLOB with lob-read-length {} required {} roundtrips", connection.lob_read_length().await?, connection.get_call_count().await? - before ); assert_eq!(mydata, second); // stream a blob from the database into a sink info!("read big blob in streaming fashion"); connection.set_lob_read_length(500_000).await?; let query = "select bindata as BL1, bindata as BL2, bindata_NN as BL3 from TEST_BLOBS"; let mut row = connection.query(query).await?.into_single_row().await?; let blob: BLob = row.next_value().unwrap().try_into_async_blob()?; let blob2: BLob = row.next_value().unwrap().try_into_async_blob()?; let mut streamed = Vec::<u8>::new(); blob2.write_into(&mut streamed).await?; assert_eq!(random_bytes.len(), streamed.len()); let mut hasher = Sha256::default(); hasher.update(&streamed); let mut streamed = Vec::<u8>::new(); blob.write_into(&mut streamed).await?; assert_eq!(random_bytes.len(), streamed.len()); let mut hasher = Sha256::default(); hasher.update(&streamed); let fingerprint4 = hasher.finalize().to_vec(); assert_eq!(fingerprint, fingerprint4.as_slice()); info!("read from somewhere within"); let mut blob: BLob = connection .query("select bindata from TEST_BLOBS") .await? .into_single_row() .await? .into_single_value()? .try_into_async_blob()?; for i in 1000..1040 { let _blob_slice = blob.read_slice(i, 100).await?; } Ok(()) } async fn test_streaming( _log_handle: &mut flexi_logger::LoggerHandle, connection: &mut Connection, random_bytes: Vec<u8>, fingerprint: &[u8], ) -> HdbResult<()> { info!("write and read big blob in streaming fashion"); connection.set_auto_commit(true).await?; connection.dml("delete from TEST_BLOBS").await?; debug!("write big blob in streaming fashion"); let mut stmt = connection .prepare("insert into TEST_BLOBS (desc, bindata_NN) values(?, ?)") .await?; // old style lob streaming: autocommit off before, explicit commit after: connection.set_auto_commit(false).await?; let reader = std::sync::Arc::new(tokio::sync::Mutex::new(std::io::Cursor::new( random_bytes.clone(), ))); stmt.execute_row(vec![ HdbValue::STRING("streaming1".to_string()), HdbValue::ASYNC_LOBSTREAM(Some(reader)), ]) .await?; connection.commit().await?; assert_eq!( random_bytes.len(), connection .query("select length(BINDATA_NN) from TEST_BLOBS") .await? .try_into::<usize>() .await?, "data length in database is not as expected" ); // new style lob streaming: with autocommit connection.set_auto_commit(true).await?; let reader = std::sync::Arc::new(tokio::sync::Mutex::new(std::io::Cursor::new( random_bytes.clone(), ))); stmt.execute_row(vec![ HdbValue::STRING("streaming2".to_string()), HdbValue::ASYNC_LOBSTREAM(Some(reader)), ]) .await?; debug!("read big blob in streaming fashion"); connection.set_lob_read_length(200_000).await?; let blob = connection .query("select bindata_NN from TEST_BLOBS where desc = 'streaming2'") .await? .into_single_row() .await? .into_single_value()? .try_into_async_blob()?; let mut buffer = Vec::<u8>::new(); blob.write_into(&mut buffer).await?; assert_eq!(random_bytes.len(), buffer.len()); let mut hasher = Sha256::default(); hasher.update(&buffer); let fingerprint4 = hasher.finalize().to_vec(); assert_eq!(fingerprint, fingerprint4.as_slice()); connection.set_auto_commit(true).await?; Ok(()) }
use std::collections::btree_map::{IterMut, OccupiedEntry, RangeMut, VacantEntry}; // revisions: base nll // ignore-compare-mode-nll //[nll] compile-flags: -Z borrowck=mir fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn range_cov_key<'a, 'new>(v: RangeMut<'a, &'static (), ()>) -> RangeMut<'a, &'new (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn range_cov_val<'a, 'new>(v: RangeMut<'a, (), &'static ()>) -> RangeMut<'a, (), &'new ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn range_contra_key<'a, 'new>(v: RangeMut<'a, &'new (), ()>) -> RangeMut<'a, &'static (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn range_contra_val<'a, 'new>(v: RangeMut<'a, (), &'new ()>) -> RangeMut<'a, (), &'static ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) -> OccupiedEntry<'a, &'new (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) -> OccupiedEntry<'a, (), &'new ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) -> OccupiedEntry<'a, &'static (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) -> OccupiedEntry<'a, (), &'static ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) -> VacantEntry<'a, &'new (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) -> VacantEntry<'a, (), &'new ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) -> VacantEntry<'a, &'static (), ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) -> VacantEntry<'a, (), &'static ()> { v //[base]~^ ERROR mismatched types //[nll]~^^ lifetime may not live long enough } fn main() { }
use ascii::AsciiChar; use core::ptr::Unique; use krnl::port; use krnl::port::Port; use spin::Mutex; use volatile::Volatile; // // ------------------> y (80) // | > _ | // | console | // | | // x-----------------x // (25) pub const MAX_ROW: usize = 25; pub const MAX_COLUMN: usize = 80; pub const SIZE: usize = MAX_ROW * MAX_COLUMN; #[derive(Clone, Copy)] #[repr(u8)] pub enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Magenta = 5, Brown = 6, LightGrey = 7, DarkGrey = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, Pink = 13, Yellow = 14, White = 15, } impl Color { const DEFAULT_FORE: Color = Color::LightGrey; const DEFAULT_BACK: Color = Color::Black; } // An attribute is composition of two colors - the foreground and background. #[derive(Clone, Copy)] pub struct Attribute(u8); impl Attribute { pub const fn new(fore: Color, back: Color) -> Attribute { Attribute((back as u8) << 4 | (fore as u8)) } } impl Default for Attribute { fn default() -> Attribute { Attribute::new(Color::DEFAULT_FORE, Color::DEFAULT_BACK) } } #[derive(Clone, Copy, Default)] #[repr(C)] pub struct ScreenChar { pub ch: u8, pub attrib: Attribute, } impl ScreenChar { pub const fn new(ch: u8, attrib: Attribute) -> ScreenChar { ScreenChar { ch, attrib } } } pub type ConsoleBuf = [[ScreenChar; MAX_COLUMN]; MAX_ROW]; pub type ConsoleBufVolatile = [[Volatile<ScreenChar>; MAX_COLUMN]; MAX_ROW]; struct Cursor { vport: Port, x: usize, // row y: usize, // column show: bool, } impl Cursor { fn go(vport: Port, x: usize, y: usize) { let offset: usize = x * MAX_COLUMN + y; let vport2: Port = vport.silbing(); unsafe { port::outb(vport, 14); port::outb(vport2, (offset >> 8) as u8); port::outb(vport, 15); port::outb(vport2, offset as u8); } } fn new(vport: Port) -> Cursor { let mut offset: usize; let vport2: Port = vport.silbing(); unsafe { port::outb(vport, 0xe); offset = (port::inb(vport2) as usize) << 8; port::outb(vport, 0xf); offset += port::inb(vport2) as usize; } let x: usize = offset / MAX_COLUMN; let y: usize = offset % MAX_COLUMN; Cursor { vport: vport, x: x, y: y, show: true, } } fn push(&self) { if self.show { Cursor::go(self.vport, self.x, self.y) } } fn hide(&mut self) { self.show = false; Cursor::go(self.vport, MAX_ROW, 0) } } pub struct Console { buf: Unique<ConsoleBufVolatile>, // volatile buffer to prevent Rust from optimizing writes away. cursor: Cursor, attrib: Attribute, } lazy_static! { pub static ref CONSOLE: Mutex<Console> = { let vport = unsafe { Port::new(*(0x463 as *mut u16)) }; let console = Console { buf: unsafe { Unique::new_unchecked(0xb8000 as *mut _) }, cursor: Cursor::new(vport), attrib: Default::default(), }; Mutex::new(console) }; } impl Console { fn buf_ref(&self) -> &ConsoleBufVolatile { unsafe { self.buf.as_ref() } } fn buf_mut(&mut self) -> &mut ConsoleBufVolatile { unsafe { self.buf.as_mut() } } fn scroll(&mut self) { let space = ScreenChar { ch: AsciiChar::Space as u8, attrib: self.attrib, }; for row in 0..MAX_ROW - 1 { for col in 0..MAX_COLUMN { let old = self.buf_ref()[row + 1][col].read(); self.buf_mut()[row][col].write(old); } } for col in 0..MAX_COLUMN { self.buf_mut()[MAX_ROW - 1][col].write(space); } } pub fn hide_cursor(&mut self) { self.cursor.hide() } pub fn setcolor(&mut self, fore: Color, back: Color, reset: bool) { let attrib: Attribute = Attribute::new(fore, back); if reset { for row in 0..MAX_ROW { for col in 0..MAX_COLUMN { let ch = self.buf_ref()[row][col].read().ch; self.buf_mut()[row][col].write(ScreenChar { ch, attrib }); } } } self.attrib = attrib } pub fn clear(&mut self) { let space = ScreenChar { ch: AsciiChar::Space as u8, attrib: self.attrib, }; for row in 0..MAX_ROW { for col in 0..MAX_COLUMN { self.buf_mut()[row][col].write(space); } } self.cursor.x = 0; self.cursor.y = 0; self.cursor.push(); unsafe { port::wait() } } pub fn bkcpy(&mut self, buf: &ConsoleBuf) { for row in 0..MAX_ROW { for col in 0..MAX_COLUMN { self.buf_mut()[row][col].write(buf[row][col]); } } self.cursor.x = 0; self.cursor.y = 0; self.cursor.push(); unsafe { port::wait() } } pub fn putch(&mut self, ch: u8) { match AsciiChar::from(ch).unwrap() { AsciiChar::BackSpace => { if self.cursor.y != 0 { self.cursor.y -= 1; } }, AsciiChar::Tab => { self.cursor.y = (self.cursor.y + 4) & !3; }, AsciiChar::CarriageReturn => { self.cursor.y = 0; }, AsciiChar::LineFeed => { self.cursor.y = 0; self.cursor.x += 1; }, _ => { let row = self.cursor.x; let col = self.cursor.y; let attrib = self.attrib; self.buf_mut()[row][col].write(ScreenChar { ch, attrib }); self.cursor.y += 1; }, } if self.cursor.y >= MAX_COLUMN { self.cursor.y = 0; self.cursor.x += 1; } if self.cursor.x >= MAX_ROW { self.scroll(); self.cursor.x -= 1; } self.cursor.push() } } pub fn initialize() { let mut console = CONSOLE.lock(); console.setcolor(Color::DEFAULT_FORE, Color::DEFAULT_BACK, true); console.clear(); }
// Copyright 2019. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the // following disclaimer in the documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote // products derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. use crate::{ consensus::network::Network, proof_of_work::{Difficulty, PowAlgorithm}, transactions::tari_amount::{uT, MicroTari, T}, }; use chrono::{DateTime, Duration, Utc}; use std::ops::Add; use tari_crypto::tari_utilities::epoch_time::EpochTime; /// This is the inner struct used to control all consensus values. #[derive(Clone)] pub struct ConsensusConstants { /// The min height maturity a coinbase utxo must have coinbase_lock_height: u64, /// Current version of the blockchain blockchain_version: u16, /// The Future Time Limit (FTL) of the blockchain in seconds. This is the max allowable timestamp that is excepted. /// We use TxN/20 where T = target time = 60 seconds, and N = block_window = 150 future_time_limit: u64, /// This is the our target time in seconds between blocks target_block_interval: u64, /// When doing difficulty adjustments and FTL calculations this is the amount of blocks we look at difficulty_block_window: u64, /// When doing difficulty adjustments, this is the maximum block time allowed difficulty_max_block_interval: u64, /// Maximum transaction weight used for the construction of new blocks. max_block_transaction_weight: u64, /// The amount of PoW algorithms used by the Tari chain. pow_algo_count: u64, /// This is how many blocks we use to count towards the median timestamp to ensure the block chain moves forward median_timestamp_count: usize, /// This is the initial emission curve amount pub(in crate::consensus) emission_initial: MicroTari, /// This is the emission curve delay pub(in crate::consensus) emission_decay: f64, /// This is the emission curve tail amount pub(in crate::consensus) emission_tail: MicroTari, /// This is the initial min difficulty for the difficulty adjustment min_pow_difficulty: (Difficulty, Difficulty), } // The target time used by the difficulty adjustment algorithms, their target time is the target block interval * PoW // algorithm count impl ConsensusConstants { /// This gets the emission curve values as (initial, decay, tail) pub fn emission_amounts(&self) -> (MicroTari, f64, MicroTari) { (self.emission_initial, self.emission_decay, self.emission_tail) } /// The min height maturity a coinbase utxo must have. pub fn coinbase_lock_height(&self) -> u64 { self.coinbase_lock_height } /// Current version of the blockchain. pub fn blockchain_version(&self) -> u16 { self.blockchain_version } /// This returns the FTL(Future Time Limit) for blocks /// Any block with a timestamp greater than this is rejected. pub fn ftl(&self) -> EpochTime { (Utc::now() .add(Duration::seconds(self.future_time_limit as i64)) .timestamp() as u64) .into() } /// This returns the FTL(Future Time Limit) for blocks /// Any block with a timestamp greater than this is rejected. /// This function returns the FTL as a UTC datetime pub fn ftl_as_time(&self) -> DateTime<Utc> { Utc::now().add(Duration::seconds(self.future_time_limit as i64)) } /// This is the our target time in seconds between blocks. pub fn get_target_block_interval(&self) -> u64 { self.target_block_interval } /// When doing difficulty adjustments and FTL calculations this is the amount of blocks we look at. pub fn get_difficulty_block_window(&self) -> u64 { self.difficulty_block_window } /// Maximum transaction weight used for the construction of new blocks. pub fn get_max_block_transaction_weight(&self) -> u64 { self.max_block_transaction_weight } /// The amount of PoW algorithms used by the Tari chain. pub fn get_pow_algo_count(&self) -> u64 { self.pow_algo_count } /// The target time used by the difficulty adjustment algorithms, their target time is the target block interval * /// PoW algorithm count. pub fn get_diff_target_block_interval(&self) -> u64 { self.pow_algo_count * self.target_block_interval } /// The maximum time a block is considered to take. Used by the difficulty adjustment algorithms /// Multiplied by the PoW algorithm count. pub fn get_difficulty_max_block_interval(&self) -> u64 { self.pow_algo_count * self.difficulty_max_block_interval } /// This is how many blocks we use to count towards the median timestamp to ensure the block chain moves forward. pub fn get_median_timestamp_count(&self) -> usize { self.median_timestamp_count } // This is the min initial difficulty that can be requested for the pow pub fn min_pow_difficulty(&self, pow_algo: PowAlgorithm) -> Difficulty { match pow_algo { PowAlgorithm::Monero => self.min_pow_difficulty.0, PowAlgorithm::Blake => self.min_pow_difficulty.1, } } #[allow(clippy::identity_op)] pub fn rincewind() -> Self { let target_block_interval = 120; let difficulty_block_window = 90; ConsensusConstants { coinbase_lock_height: 60, blockchain_version: 1, future_time_limit: target_block_interval * difficulty_block_window / 20, target_block_interval, difficulty_block_window, difficulty_max_block_interval: target_block_interval * 60, max_block_transaction_weight: 19500, pow_algo_count: 1, median_timestamp_count: 11, emission_initial: 5_538_846_115 * uT, emission_decay: 0.999_999_560_409_038_5, emission_tail: 1 * T, min_pow_difficulty: (1.into(), 60_000_000.into()), } } pub fn localnet() -> Self { let target_block_interval = 120; let difficulty_block_window = 90; ConsensusConstants { coinbase_lock_height: 1, blockchain_version: 1, future_time_limit: target_block_interval * difficulty_block_window / 20, target_block_interval, difficulty_max_block_interval: target_block_interval * 6, difficulty_block_window, max_block_transaction_weight: 19500, pow_algo_count: 2, median_timestamp_count: 11, emission_initial: 10_000_000.into(), emission_decay: 0.999, emission_tail: 100.into(), min_pow_difficulty: (1.into(), 1.into()), } } pub fn mainnet() -> Self { // Note these values are all placeholders for final values let target_block_interval = 120; let difficulty_block_window = 90; ConsensusConstants { coinbase_lock_height: 1, blockchain_version: 1, future_time_limit: target_block_interval * difficulty_block_window / 20, target_block_interval, difficulty_max_block_interval: target_block_interval * 6, difficulty_block_window, max_block_transaction_weight: 19500, pow_algo_count: 2, median_timestamp_count: 11, emission_initial: 10_000_000.into(), emission_decay: 0.999, emission_tail: 100.into(), min_pow_difficulty: (1.into(), 500_000_000.into()), } } } /// Class to create custom consensus constants pub struct ConsensusConstantsBuilder { consensus: ConsensusConstants, } impl ConsensusConstantsBuilder { pub fn new(network: Network) -> ConsensusConstantsBuilder { ConsensusConstantsBuilder { consensus: network.create_consensus_constants(), } } pub fn with_coinbase_lockheight(mut self, height: u64) -> ConsensusConstantsBuilder { self.consensus.coinbase_lock_height = height; self } pub fn with_emission_amounts( mut self, intial_amount: MicroTari, decay: f64, tail_amount: MicroTari, ) -> ConsensusConstantsBuilder { self.consensus.emission_initial = intial_amount; self.consensus.emission_decay = decay; self.consensus.emission_tail = tail_amount; self } pub fn build(self) -> ConsensusConstants { self.consensus } }
//! Traits and structures relating to and for managing commands. Commands are messages sent from //! outside the physics simulation to alter how the physics simulation runs. For example, causing a //! rigid body for a player to jump requires a jump command, and causing a player to spawn requires //! a spawn command. use super::timestamp::{Timestamp, Timestamped}; // use serde::{de::DeserializeOwned, Serialize}; use std::{cmp::Reverse, collections::BTreeMap, fmt::Debug, ops::Range}; /// A command is a request to change the physics simulation in some way, issued from outside the /// physics simulation. It is the way in which players and any non-physics game logic can interact /// with the physics simulation. /// /// # Example /// /// ``` /// use orb::command::Command; /// /// #[derive(Debug, Clone)] /// struct Player(usize); /// /// #[derive(Debug, Clone)] /// enum GameCommand { /// Spawn(Player), /// Despawn(Player), /// Jump(Player), /// Left(Player), /// Right(Player), /// } /// /// impl Command for GameCommand {}; /// ``` pub trait Command: Clone + Sync + Send + 'static + /*Serialize + DeserializeOwned +*/ Debug {} /// A handy structure for receiving commands out-of-order, and consuming them in-order. This also /// unintuitively keeps track of the "current" timestamp for whatever uses this [`CommandBuffer`]. /// This is because the [`CommandBuffer`] needs to maintain an acceptable window of command /// timestamps centered around the current timestamp, or else the command timestamps would be too /// far about and [wouldn't be /// comparable](crate::timestamp::Timestamp::comparable_range_with_midpoint). #[derive(Clone, Debug)] pub(crate) struct CommandBuffer<CommandType: Command> { map: BTreeMap<Reverse<Timestamp>, Vec<CommandType>>, timestamp: Timestamp, } impl<CommandType: Command> Default for CommandBuffer<CommandType> { fn default() -> Self { Self { map: BTreeMap::new(), timestamp: Timestamp::default(), } } } impl<CommandType: Command> CommandBuffer<CommandType> { pub fn new() -> Self { Self::default() } /// The command buffer attempts to sort the commands by their timestamp, but the timestamps /// uses a wrapped difference to calculate the ordering. In order to prevent stale commands /// from being replayed, and in order to keep the commands transitively consistently /// ordered, we restrict the command buffer to only half of the available timestamp /// datasize. pub fn acceptable_timestamp_range(&self) -> Range<Timestamp> { Timestamp::comparable_range_with_midpoint(self.timestamp) } pub fn timestamp(&self) -> Timestamp { self.timestamp } pub fn update_timestamp(&mut self, timestamp: Timestamp) { self.timestamp = timestamp; // Now we discard commands that fall outside of the acceptable timestamp range. // (1) future commands are still accepted into the command buffer without breaking the // transitivity laws. // (2) stale commands are discarded so that they don't wrap around and replayed again like // a ghost. let acceptable_timestamp_range = self.acceptable_timestamp_range(); // Discard stale commands. let stale_commands = self .map .split_off(&Reverse(acceptable_timestamp_range.start - 1)); if !stale_commands.is_empty() { log::warn!( "Discarded {:?} stale commands due to timestamp update! This should rarely happen. The commands were {:?}", stale_commands.len(), stale_commands ); } // In case we rewind the midpoint timestamp, discard commands too far in the future. loop { // Note: since the map is reversed, the latest command is ordered first. if let Some(key) = self.map.keys().next() { if let Some(value) = self.map.get(key) { if key.0 >= acceptable_timestamp_range.end { log::warn!("Discarding future command {:?} after timestamp update! This should rarely happen", value); let key_to_remove = *key; self.map.remove(&key_to_remove); continue; } } } break; } } pub fn insert(&mut self, command: &Timestamped<CommandType>) { if self .acceptable_timestamp_range() .contains(&command.timestamp()) { if let Some(commands_at_timestamp) = self.map.get_mut(&Reverse(command.timestamp())) { commands_at_timestamp.push(command.inner().clone()); } else { self.map .insert(Reverse(command.timestamp()), vec![command.inner().clone()]); } } else { log::warn!( "Tried to insert a command of timestamp {:?} outside of the acceptable range {:?}. The command {:?} is dropped", command.timestamp(), self.acceptable_timestamp_range(), command ); } } pub fn drain_up_to(&mut self, newest_timestamp_to_drain: Timestamp) -> Vec<CommandType> { self.map .split_off(&Reverse(newest_timestamp_to_drain)) .values() .rev() // Our map is in reverse order. .flatten() .cloned() .collect() } pub fn drain_all(&mut self) -> Vec<CommandType> { let commands = self.map.values().rev().flatten().cloned().collect(); self.map.clear(); commands } #[allow(dead_code)] pub fn commands_at(&self, timestamp: Timestamp) -> Option<impl Iterator<Item = &CommandType>> { self.map .get(&Reverse(timestamp)) .map(|commands| commands.iter()) } #[allow(dead_code)] pub fn len(&self) -> usize { self.map.len() } pub fn iter(&self) -> impl Iterator<Item = (Timestamp, &Vec<CommandType>)> { self.map .iter() .rev() .map(|(timestamp, commands)| (timestamp.0, commands)) } } #[cfg(test)] mod tests { use super::*; impl Command for i32 {} #[test] fn when_timestamp_incremented_then_command_buffer_discards_stale_commands() { // GIVEN a command buffer with old commands, one of which is at the lowest extreme of the // acceptable range. let mut command_buffer = CommandBuffer::<i32>::new(); let acceptable_range = command_buffer.acceptable_timestamp_range(); let t = [ acceptable_range.start, acceptable_range.start + 1, acceptable_range.end - 2, acceptable_range.end - 1, ]; command_buffer.insert(&Timestamped::new(0, t[0])); command_buffer.insert(&Timestamped::new(1, t[1])); command_buffer.insert(&Timestamped::new(2, t[2])); command_buffer.insert(&Timestamped::new(3, t[3])); assert_eq!( *command_buffer.commands_at(t[0]).unwrap().next().unwrap(), 0 ); assert_eq!( *command_buffer.commands_at(t[1]).unwrap().next().unwrap(), 1 ); assert_eq!( *command_buffer.commands_at(t[2]).unwrap().next().unwrap(), 2 ); assert_eq!( *command_buffer.commands_at(t[3]).unwrap().next().unwrap(), 3 ); // WHEN we increment the timestamp. command_buffer.update_timestamp(command_buffer.timestamp() + 1); // THEN only the one command that now falls outside of the new acceptable range gets // discared. assert!(command_buffer.commands_at(t[0]).is_none()); assert_eq!( *command_buffer.commands_at(t[1]).unwrap().next().unwrap(), 1 ); assert_eq!( *command_buffer.commands_at(t[2]).unwrap().next().unwrap(), 2 ); assert_eq!( *command_buffer.commands_at(t[3]).unwrap().next().unwrap(), 3 ); } #[test] fn when_timestamp_decremented_then_command_buffer_discards_unripe_commands() { // GIVEN a command buffer with old commands, one of which is at the highest extreme of the // acceptable range. let mut command_buffer = CommandBuffer::<i32>::new(); let acceptable_range = command_buffer.acceptable_timestamp_range(); let t = [ acceptable_range.start, acceptable_range.start + 1, acceptable_range.end - 2, acceptable_range.end - 1, ]; command_buffer.insert(&Timestamped::new(0, t[0])); command_buffer.insert(&Timestamped::new(1, t[1])); command_buffer.insert(&Timestamped::new(2, t[2])); command_buffer.insert(&Timestamped::new(3, t[3])); assert_eq!( *command_buffer.commands_at(t[0]).unwrap().next().unwrap(), 0 ); assert_eq!( *command_buffer.commands_at(t[1]).unwrap().next().unwrap(), 1 ); assert_eq!( *command_buffer.commands_at(t[2]).unwrap().next().unwrap(), 2 ); assert_eq!( *command_buffer.commands_at(t[3]).unwrap().next().unwrap(), 3 ); // WHEN we decrement the timestamp. command_buffer.update_timestamp(command_buffer.timestamp() - 1); // THEN only the one command that now falls outside of the new acceptable range gets // discared. assert_eq!( *command_buffer.commands_at(t[0]).unwrap().next().unwrap(), 0 ); assert_eq!( *command_buffer.commands_at(t[1]).unwrap().next().unwrap(), 1 ); assert_eq!( *command_buffer.commands_at(t[2]).unwrap().next().unwrap(), 2 ); assert!(command_buffer.commands_at(t[3]).is_none()); } #[test] fn when_inserting_command_outside_acceptable_range_then_command_is_discarded() { // GIVEN an empty command buffer let mut command_buffer = CommandBuffer::<i32>::new(); // WHEN we insert commands, some of which are outside the acceptable range. let acceptable_range = command_buffer.acceptable_timestamp_range(); let t = [ acceptable_range.start - 1, acceptable_range.start, acceptable_range.end - 1, acceptable_range.end, acceptable_range.end + Timestamp::MAX_COMPARABLE_RANGE / 2, ]; command_buffer.insert(&Timestamped::new(0, t[0])); command_buffer.insert(&Timestamped::new(1, t[1])); command_buffer.insert(&Timestamped::new(2, t[2])); command_buffer.insert(&Timestamped::new(3, t[3])); command_buffer.insert(&Timestamped::new(4, t[4])); assert!(command_buffer.commands_at(t[0]).is_none()); assert_eq!( *command_buffer.commands_at(t[1]).unwrap().next().unwrap(), 1 ); assert_eq!( *command_buffer.commands_at(t[2]).unwrap().next().unwrap(), 2 ); assert!(command_buffer.commands_at(t[3]).is_none()); assert!(command_buffer.commands_at(t[4]).is_none()); } #[test] fn test_drain_up_to() { // GIVEN a command buffer with several commands. let mut command_buffer = CommandBuffer::<i32>::new(); command_buffer.insert(&Timestamped::new(0, command_buffer.timestamp() + 1)); command_buffer.insert(&Timestamped::new(1, command_buffer.timestamp() + 5)); command_buffer.insert(&Timestamped::new(2, command_buffer.timestamp() + 2)); command_buffer.insert(&Timestamped::new(3, command_buffer.timestamp() + 4)); command_buffer.insert(&Timestamped::new(4, command_buffer.timestamp() + 8)); command_buffer.insert(&Timestamped::new(5, command_buffer.timestamp() + 6)); command_buffer.insert(&Timestamped::new(6, command_buffer.timestamp() + 7)); command_buffer.insert(&Timestamped::new(7, command_buffer.timestamp() + 3)); // WHEN we drain the command buffer up to a certain timestamp. let drained_commands = command_buffer.drain_up_to(command_buffer.timestamp() + 4); // THEN we get the commands up to and including the specified timestamp, in order. assert_eq!(drained_commands.len(), 4); assert_eq!(drained_commands[0], 0); assert_eq!(drained_commands[1], 2); assert_eq!(drained_commands[2], 7); assert_eq!(drained_commands[3], 3); // THEN we the command buffer will have discarded commands up to and including the // specified timestamp, while keeping the other commands. assert!(command_buffer .commands_at(command_buffer.timestamp() + 1) .is_none()); assert!(command_buffer .commands_at(command_buffer.timestamp() + 2) .is_none()); assert!(command_buffer .commands_at(command_buffer.timestamp() + 3) .is_none()); assert!(command_buffer .commands_at(command_buffer.timestamp() + 4) .is_none()); assert_eq!( *command_buffer .commands_at(command_buffer.timestamp() + 5) .unwrap() .next() .unwrap(), 1 ); assert_eq!( *command_buffer .commands_at(command_buffer.timestamp() + 6) .unwrap() .next() .unwrap(), 5 ); assert_eq!( *command_buffer .commands_at(command_buffer.timestamp() + 7) .unwrap() .next() .unwrap(), 6 ); assert_eq!( *command_buffer .commands_at(command_buffer.timestamp() + 8) .unwrap() .next() .unwrap(), 4 ); } }
#[macro_use] mod common; use common::util::*; static UTIL_NAME: &'static str = "tac"; #[test] fn test_stdin_default() { let (_, mut ucmd) = testing(UTIL_NAME); let result = ucmd.run_piped_stdin("100\n200\n300\n400\n500"); assert_eq!(result.stdout, "500400\n300\n200\n100\n"); } #[test] fn test_stdin_non_newline_separator() { let (_, mut ucmd) = testing(UTIL_NAME); let result = ucmd.args(&["-s", ":"]).run_piped_stdin("100:200:300:400:500"); assert_eq!(result.stdout, "500400:300:200:100:"); } #[test] fn test_stdin_non_newline_separator_before() { let (_, mut ucmd) = testing(UTIL_NAME); let result = ucmd.args(&["-b", "-s", ":"]).run_piped_stdin("100:200:300:400:500"); assert_eq!(result.stdout, "500:400:300:200:100"); } #[test] fn test_single_default() { let (at, mut ucmd) = testing(UTIL_NAME); let result = ucmd.arg("prime_per_line.txt").run(); assert_eq!(result.stdout, at.read("prime_per_line.expected")); } #[test] fn test_single_non_newline_separator() { let (at, mut ucmd) = testing(UTIL_NAME); let result = ucmd.args(&["-s", ":", "delimited_primes.txt"]).run(); assert_eq!(result.stdout, at.read("delimited_primes.expected")); } #[test] fn test_single_non_newline_separator_before() { let (at, mut ucmd) = testing(UTIL_NAME); let result = ucmd.args(&["-b", "-s", ":", "delimited_primes.txt"]).run(); assert_eq!(result.stdout, at.read("delimited_primes_before.expected")); }
use handler::{RequestHandler, RequestRouter}; use request::{Bundle, Request}; use state::Container; pub use vostok_codegen::request; pub use vostok_codegen::routes; pub mod handler; pub mod request; pub mod response; pub struct Vostok<Req: 'static, Res: 'static> { state: Container, router: RequestRouter<Req, Res>, } impl<Req: Request, Res> Vostok<Req, Res> { pub fn build() -> Self { Vostok { state: Container::new(), router: RequestRouter::new(), } } pub fn manage<T: Send + Sync + 'static>(self, state: T) -> Self { self.state.set(state); self } pub fn route(mut self, routes: Vec<&'static dyn RequestHandler<Req, Res>>) -> Self { self.router.add_handlers(routes); self } pub async fn handle(&self, req: Req) -> Option<Res> { let bundle = Bundle { state: &self.state, request: req, }; self.router.route(&bundle).await } }
use std::process; pub fn print_usage_error(code: u32) { if code == 1 { println!("ERROR::USAGE:: Enter each row of a sudoku puzzle seperated by spaces, use a '.' for an empty value"); } if code == 2 { println!("ERROR::USAGE:: Each row must be exactly 9 characters"); } if code == 3 { println!("ERROR::USAGE:: Invalid character in sudoku row"); } if code == 4 { println!("ERROR::USAGE:: Invalid sudoku puzzle"); } process::exit(-1); }
/* * Copyright (C) 2020 Zixiao Han */ static SEED_C89: u64 = 0b10110110_00101111_10100100_01011000_00001000_01100100_11010111_11111010; static SEED_A86: u64 = 0b10111001_11010011_00111100_00010100_00110000_00100110_11001111_10110110; const fn rotate(x: u64, k: usize) -> u64 { (x << k) | (x >> (64 - k)) } pub struct XorshiftPrng { state: [u64; 2], } impl XorshiftPrng { pub fn new() -> XorshiftPrng { XorshiftPrng { state: [SEED_C89, SEED_A86], } } #[allow(arithmetic_overflow)] pub fn gen_rand(&mut self) -> u64 { let s0 = self.state[0]; let mut s1 = self.state[1]; let next_rand = rotate(s0 * 5, 7) * 9; s1 ^= s0; self.state[0] = rotate(s0, 24) ^ s1 ^ (s1 << 16); self.state[1] = rotate(s1, 37); next_rand } pub fn create_prn_list(&mut self, dim: usize) -> Vec<u64> { let mut prn_table = vec![0; dim]; for i in 0..dim { let mut prn = self.gen_rand(); 'trail_error: loop { for ii in 0..i { if prn_table[ii] == prn { prn = self.gen_rand(); continue 'trail_error } } break } prn_table[i] = prn; } prn_table } pub fn create_prn_table(&mut self, fst_dim: usize, snd_dim: usize) -> Vec<Vec<u64>> { let mut prn_table = vec![vec![0; snd_dim]; fst_dim]; for i in 0..fst_dim { for j in 0..snd_dim { let mut prn = self.gen_rand(); 'trail_error: loop { for ii in 0..i { for jj in 0..j { if prn_table[ii][jj] == prn { prn = self.gen_rand(); continue 'trail_error } } } break } prn_table[i][j] = prn; } } prn_table } } #[cfg(test)] mod tests { use super::*; use crate::def; #[test] fn test_gen_rand_table() { let mut rand = XorshiftPrng::new(); let rand_table = rand.create_prn_table(def::BOARD_SIZE, def::PIECE_CODE_RANGE); let mut hash_key = 0; for i in 0..def::BOARD_SIZE { for j in 0..def::PIECE_CODE_RANGE { hash_key ^= rand_table[i][j]; if hash_key == 0 { panic!("bad hash"); } } } } #[test] fn test_gen_rand_list() { let mut rand = XorshiftPrng::new(); let rand_list = rand.create_prn_list(def::BOARD_SIZE); let mut hash_key = 0; for i in 0..def::BOARD_SIZE { hash_key ^= rand_list[i]; if hash_key == 0 { panic!("bad hash"); } } println!("{:?}", rand_list) } }
/* * @lc app=leetcode.cn id=415 lang=rust * * [415] 字符串相加 * * https://leetcode-cn.com/problems/add-strings/description/ * * algorithms * Easy (43.32%) * Total Accepted: 5.3K * Total Submissions: 12.2K * Testcase Example: '"0"\n"0"' * * 给定两个字符串形式的非负整数 num1 和num2 ,计算它们的和。 * * 注意: * * * num1 和num2 的长度都小于 5100. * num1 和num2 都只包含数字 0-9. * num1 和num2 都不包含任何前导零。 * 你不能使用任何內建 BigInteger 库, 也不能直接将输入的字符串转换为整数形式。 * * */ use std::collections::vec_deque::VecDeque; impl Solution { pub fn add_strings(num1: String, num2: String) -> String { let num1: VecDeque<u8> = num1 .chars() .map(|c| c.to_string().parse().unwrap()) .collect(); let num2: VecDeque<u8> = num2 .chars() .map(|c| c.to_string().parse().unwrap()) .collect(); add(&num1, &num2).iter().map(|it| it.to_string()).collect() } } /// 两个大数相加 [1,2,4] + [4,8] = [1,7,2] fn add(num1: &VecDeque<u8>, num2: &VecDeque<u8>) -> VecDeque<u8> { if num1.len() < num2.len() { return add(num2, num1); } let (l1, l2) = (num1.len() - 1, num2.len() - 1); let mut res = VecDeque::new(); // 保存结果 let mut flag = 0; // 进位标识 for i in 0..num2.len() { let t = num1[l1 - i] + num2[l2 - i] + flag; res.push_front(t % 10); flag = t / 10; } for i in num2.len()..num1.len() { let t = num1[l1 - i] + flag; res.push_front(t % 10); flag = t / 10; } if flag != 0 { res.push_front(flag); } res } fn main() { let num1: u64 = 1122222; let num2: u64 = 0; let s = Solution::add_strings(num1.to_string(), num2.to_string()); println!("{},{}", s, num1 + num2); } struct Solution {}
mod state; mod timer; mod audio; mod winner; mod ball; mod paddle; mod taunt; mod persistence; use amethyst::{ prelude::*, renderer::{ plugins::{RenderFlat2D, RenderToWindow}, types::DefaultBackend, RenderingBundle, }, utils::application_root_dir, Result, }; use amethyst::core::TransformBundle; use amethyst::input::{InputBundle, StringBindings}; use amethyst::ui::{RenderUi, UiBundle}; use amethyst::audio::{AudioBundle, DjSystemDesc}; use crate::audio::audio::Music; use state::start::StartScreen; use amethyst::window::{DisplayConfig}; use amethyst::winit::Icon; use crate::persistence::Settings; #[macro_use] extern crate serde; fn main() -> Result<()> { amethyst::start_logger(Default::default()); let app_root = application_root_dir()?; let mut display_config = DisplayConfig::default(); let settings = Settings::read_or_default(); display_config.loaded_icon = Some(Icon::from_path("assets/texture/logo.png")?); display_config.dimensions = Some((settings.window_settings.arena_width() as u32, settings.window_settings.arena_height() as u32)); let input_bundle = InputBundle::<StringBindings>::new() .with_bindings_from_file(app_root.join("config").join("bindings.ron"))?; let game_data = GameDataBuilder::default() .with_bundle( RenderingBundle::<DefaultBackend>::new() // The RenderToWindow plugin provides all the scaffolding for opening a window and drawing on it .with_plugin( RenderToWindow::from_config(display_config) .with_clear([0.0, 0.0, 0.0, 1.0]), ) // RenderFlat2D plugin is used to render entities with a `SpriteRender` component. .with_plugin(RenderFlat2D::default()) .with_plugin(RenderUi::default()), )? .with_bundle(TransformBundle::new())? .with_bundle(input_bundle)? .with_bundle(UiBundle::<StringBindings>::new())? .with_bundle(AudioBundle::default())? .with_system_desc( DjSystemDesc::new(|music: &mut Music| music.music.next()), "dj_system", &[], ) .with(ball::ball_system::MoveBallsSystem, "ball_system", &[]) .with(timer::timer_system::TimerSystem, "timer_system", &[]) .with(taunt::taunt_system::TauntSystem, "taunt_system", &[]) .with(ball::trajectory_system::TrajectorySystem, "trajectory_system", &["ball_system"]) .with(paddle::paddle::PaddleSystem, "paddle_system", &["input_system", "trajectory_system"]) .with(ball::bounce_system::BounceSystem, "collision_system", &["paddle_system", "ball_system"]) .with(winner::winner::WinnerSystem, "winner_system", &["ball_system"]); let assets_dir = app_root.join("assets"); let mut game = Application::new(assets_dir, StartScreen::new(settings), game_data)?; game.run(); Ok(()) }
use std::io; use std::cmp::Ordering; use rand::Rng; fn main() { println!("Hello, rusty!"); loop { println!("Guess a number (type 'c' to exit): "); let mut guess = String::new(); io::stdin() .read_line(&mut guess) .expect("Faile to read line"); let guess = guess.trim(); if guess.eq("c") | guess.eq("C") { println!("Exiting..."); break; } let guess: u32 = match guess.parse() { Ok(num) => num, Err(_) => continue }; println!("Your guess is {}", guess); let secret_number = rand::thread_rng().gen_range(1, 101); match guess.cmp(&secret_number) { Ordering::Less => println!("Your guess is less. Right number is {}", secret_number), Ordering::Greater => println!("Your guess is high. Right number is {}", secret_number), Ordering::Equal => { println!("Congratulation ! You guessed exact number"); break; } } } }
#[doc = "Reader of register FLTINR3"] pub type R = crate::R<u32, super::FLTINR3>; #[doc = "Writer for register FLTINR3"] pub type W = crate::W<u32, super::FLTINR3>; #[doc = "Register FLTINR3 `reset()`'s with value 0"] impl crate::ResetValue for super::FLTINR3 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Reader of field `FLT4RSTM`"] pub type FLT4RSTM_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT4RSTM`"] pub struct FLT4RSTM_W<'a> { w: &'a mut W, } impl<'a> FLT4RSTM_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31); self.w } } #[doc = "Reader of field `FLT4CRES`"] pub type FLT4CRES_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT4CRES`"] pub struct FLT4CRES_W<'a> { w: &'a mut W, } impl<'a> FLT4CRES_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 30)) | (((value as u32) & 0x01) << 30); self.w } } #[doc = "Reader of field `FLT4CNT`"] pub type FLT4CNT_R = crate::R<u8, u8>; #[doc = "Write proxy for field `FLT4CNT`"] pub struct FLT4CNT_W<'a> { w: &'a mut W, } impl<'a> FLT4CNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 26)) | (((value as u32) & 0x0f) << 26); self.w } } #[doc = "Reader of field `FLT4BLKS`"] pub type FLT4BLKS_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT4BLKS`"] pub struct FLT4BLKS_W<'a> { w: &'a mut W, } impl<'a> FLT4BLKS_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); self.w } } #[doc = "Reader of field `FLT4BLKE`"] pub type FLT4BLKE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT4BLKE`"] pub struct FLT4BLKE_W<'a> { w: &'a mut W, } impl<'a> FLT4BLKE_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24); self.w } } #[doc = "Reader of field `FLT3RSTM`"] pub type FLT3RSTM_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT3RSTM`"] pub struct FLT3RSTM_W<'a> { w: &'a mut W, } impl<'a> FLT3RSTM_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23); self.w } } #[doc = "Reader of field `FLT3CRES`"] pub type FLT3CRES_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT3CRES`"] pub struct FLT3CRES_W<'a> { w: &'a mut W, } impl<'a> FLT3CRES_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22); self.w } } #[doc = "Reader of field `FLT3CNT`"] pub type FLT3CNT_R = crate::R<u8, u8>; #[doc = "Write proxy for field `FLT3CNT`"] pub struct FLT3CNT_W<'a> { w: &'a mut W, } impl<'a> FLT3CNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 18)) | (((value as u32) & 0x0f) << 18); self.w } } #[doc = "Reader of field `FLT3BLKS`"] pub type FLT3BLKS_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT3BLKS`"] pub struct FLT3BLKS_W<'a> { w: &'a mut W, } impl<'a> FLT3BLKS_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); self.w } } #[doc = "Reader of field `FLT3BLKE`"] pub type FLT3BLKE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT3BLKE`"] pub struct FLT3BLKE_W<'a> { w: &'a mut W, } impl<'a> FLT3BLKE_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); self.w } } #[doc = "Reader of field `FLT2RSTM`"] pub type FLT2RSTM_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT2RSTM`"] pub struct FLT2RSTM_W<'a> { w: &'a mut W, } impl<'a> FLT2RSTM_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15); self.w } } #[doc = "Reader of field `FLT2CRES`"] pub type FLT2CRES_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT2CRES`"] pub struct FLT2CRES_W<'a> { w: &'a mut W, } impl<'a> FLT2CRES_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); self.w } } #[doc = "Reader of field `FLT2CNT`"] pub type FLT2CNT_R = crate::R<u8, u8>; #[doc = "Write proxy for field `FLT2CNT`"] pub struct FLT2CNT_W<'a> { w: &'a mut W, } impl<'a> FLT2CNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 10)) | (((value as u32) & 0x0f) << 10); self.w } } #[doc = "Reader of field `FLT2BLKS`"] pub type FLT2BLKS_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT2BLKS`"] pub struct FLT2BLKS_W<'a> { w: &'a mut W, } impl<'a> FLT2BLKS_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); self.w } } #[doc = "Reader of field `FLT2BLKE`"] pub type FLT2BLKE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT2BLKE`"] pub struct FLT2BLKE_W<'a> { w: &'a mut W, } impl<'a> FLT2BLKE_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); self.w } } #[doc = "Reader of field `FLT1RSTM`"] pub type FLT1RSTM_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT1RSTM`"] pub struct FLT1RSTM_W<'a> { w: &'a mut W, } impl<'a> FLT1RSTM_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Reader of field `FLT1CRES`"] pub type FLT1CRES_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT1CRES`"] pub struct FLT1CRES_W<'a> { w: &'a mut W, } impl<'a> FLT1CRES_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); self.w } } #[doc = "Reader of field `FLT1CNT`"] pub type FLT1CNT_R = crate::R<u8, u8>; #[doc = "Write proxy for field `FLT1CNT`"] pub struct FLT1CNT_W<'a> { w: &'a mut W, } impl<'a> FLT1CNT_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 2)) | (((value as u32) & 0x0f) << 2); self.w } } #[doc = "Reader of field `FLT1BLKS`"] pub type FLT1BLKS_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT1BLKS`"] pub struct FLT1BLKS_W<'a> { w: &'a mut W, } impl<'a> FLT1BLKS_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); self.w } } #[doc = "Reader of field `FLT1BLKE`"] pub type FLT1BLKE_R = crate::R<bool, bool>; #[doc = "Write proxy for field `FLT1BLKE`"] pub struct FLT1BLKE_W<'a> { w: &'a mut W, } impl<'a> FLT1BLKE_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); self.w } } impl R { #[doc = "Bit 31 - FLT4RSTM"] #[inline(always)] pub fn flt4rstm(&self) -> FLT4RSTM_R { FLT4RSTM_R::new(((self.bits >> 31) & 0x01) != 0) } #[doc = "Bit 30 - FLT4CRES"] #[inline(always)] pub fn flt4cres(&self) -> FLT4CRES_R { FLT4CRES_R::new(((self.bits >> 30) & 0x01) != 0) } #[doc = "Bits 26:29 - FLT4CNT"] #[inline(always)] pub fn flt4cnt(&self) -> FLT4CNT_R { FLT4CNT_R::new(((self.bits >> 26) & 0x0f) as u8) } #[doc = "Bit 25 - FLT4BLKS"] #[inline(always)] pub fn flt4blks(&self) -> FLT4BLKS_R { FLT4BLKS_R::new(((self.bits >> 25) & 0x01) != 0) } #[doc = "Bit 24 - FLT4BLKE"] #[inline(always)] pub fn flt4blke(&self) -> FLT4BLKE_R { FLT4BLKE_R::new(((self.bits >> 24) & 0x01) != 0) } #[doc = "Bit 23 - FLT3RSTM"] #[inline(always)] pub fn flt3rstm(&self) -> FLT3RSTM_R { FLT3RSTM_R::new(((self.bits >> 23) & 0x01) != 0) } #[doc = "Bit 22 - FLT3CRES"] #[inline(always)] pub fn flt3cres(&self) -> FLT3CRES_R { FLT3CRES_R::new(((self.bits >> 22) & 0x01) != 0) } #[doc = "Bits 18:21 - FLT3CNT"] #[inline(always)] pub fn flt3cnt(&self) -> FLT3CNT_R { FLT3CNT_R::new(((self.bits >> 18) & 0x0f) as u8) } #[doc = "Bit 17 - FLT3BLKS"] #[inline(always)] pub fn flt3blks(&self) -> FLT3BLKS_R { FLT3BLKS_R::new(((self.bits >> 17) & 0x01) != 0) } #[doc = "Bit 16 - FLT3BLKE"] #[inline(always)] pub fn flt3blke(&self) -> FLT3BLKE_R { FLT3BLKE_R::new(((self.bits >> 16) & 0x01) != 0) } #[doc = "Bit 15 - FLT2RSTM"] #[inline(always)] pub fn flt2rstm(&self) -> FLT2RSTM_R { FLT2RSTM_R::new(((self.bits >> 15) & 0x01) != 0) } #[doc = "Bit 14 - FLT2CRES"] #[inline(always)] pub fn flt2cres(&self) -> FLT2CRES_R { FLT2CRES_R::new(((self.bits >> 14) & 0x01) != 0) } #[doc = "Bits 10:13 - FLT2CNT"] #[inline(always)] pub fn flt2cnt(&self) -> FLT2CNT_R { FLT2CNT_R::new(((self.bits >> 10) & 0x0f) as u8) } #[doc = "Bit 9 - FLT2BLKS"] #[inline(always)] pub fn flt2blks(&self) -> FLT2BLKS_R { FLT2BLKS_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 8 - FLT2BLKE"] #[inline(always)] pub fn flt2blke(&self) -> FLT2BLKE_R { FLT2BLKE_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 7 - FLT1RSTM"] #[inline(always)] pub fn flt1rstm(&self) -> FLT1RSTM_R { FLT1RSTM_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 6 - FLT1CRES"] #[inline(always)] pub fn flt1cres(&self) -> FLT1CRES_R { FLT1CRES_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bits 2:5 - FLT1CNT"] #[inline(always)] pub fn flt1cnt(&self) -> FLT1CNT_R { FLT1CNT_R::new(((self.bits >> 2) & 0x0f) as u8) } #[doc = "Bit 1 - FLT1BLKS"] #[inline(always)] pub fn flt1blks(&self) -> FLT1BLKS_R { FLT1BLKS_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 0 - FLT1BLKE"] #[inline(always)] pub fn flt1blke(&self) -> FLT1BLKE_R { FLT1BLKE_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bit 31 - FLT4RSTM"] #[inline(always)] pub fn flt4rstm(&mut self) -> FLT4RSTM_W { FLT4RSTM_W { w: self } } #[doc = "Bit 30 - FLT4CRES"] #[inline(always)] pub fn flt4cres(&mut self) -> FLT4CRES_W { FLT4CRES_W { w: self } } #[doc = "Bits 26:29 - FLT4CNT"] #[inline(always)] pub fn flt4cnt(&mut self) -> FLT4CNT_W { FLT4CNT_W { w: self } } #[doc = "Bit 25 - FLT4BLKS"] #[inline(always)] pub fn flt4blks(&mut self) -> FLT4BLKS_W { FLT4BLKS_W { w: self } } #[doc = "Bit 24 - FLT4BLKE"] #[inline(always)] pub fn flt4blke(&mut self) -> FLT4BLKE_W { FLT4BLKE_W { w: self } } #[doc = "Bit 23 - FLT3RSTM"] #[inline(always)] pub fn flt3rstm(&mut self) -> FLT3RSTM_W { FLT3RSTM_W { w: self } } #[doc = "Bit 22 - FLT3CRES"] #[inline(always)] pub fn flt3cres(&mut self) -> FLT3CRES_W { FLT3CRES_W { w: self } } #[doc = "Bits 18:21 - FLT3CNT"] #[inline(always)] pub fn flt3cnt(&mut self) -> FLT3CNT_W { FLT3CNT_W { w: self } } #[doc = "Bit 17 - FLT3BLKS"] #[inline(always)] pub fn flt3blks(&mut self) -> FLT3BLKS_W { FLT3BLKS_W { w: self } } #[doc = "Bit 16 - FLT3BLKE"] #[inline(always)] pub fn flt3blke(&mut self) -> FLT3BLKE_W { FLT3BLKE_W { w: self } } #[doc = "Bit 15 - FLT2RSTM"] #[inline(always)] pub fn flt2rstm(&mut self) -> FLT2RSTM_W { FLT2RSTM_W { w: self } } #[doc = "Bit 14 - FLT2CRES"] #[inline(always)] pub fn flt2cres(&mut self) -> FLT2CRES_W { FLT2CRES_W { w: self } } #[doc = "Bits 10:13 - FLT2CNT"] #[inline(always)] pub fn flt2cnt(&mut self) -> FLT2CNT_W { FLT2CNT_W { w: self } } #[doc = "Bit 9 - FLT2BLKS"] #[inline(always)] pub fn flt2blks(&mut self) -> FLT2BLKS_W { FLT2BLKS_W { w: self } } #[doc = "Bit 8 - FLT2BLKE"] #[inline(always)] pub fn flt2blke(&mut self) -> FLT2BLKE_W { FLT2BLKE_W { w: self } } #[doc = "Bit 7 - FLT1RSTM"] #[inline(always)] pub fn flt1rstm(&mut self) -> FLT1RSTM_W { FLT1RSTM_W { w: self } } #[doc = "Bit 6 - FLT1CRES"] #[inline(always)] pub fn flt1cres(&mut self) -> FLT1CRES_W { FLT1CRES_W { w: self } } #[doc = "Bits 2:5 - FLT1CNT"] #[inline(always)] pub fn flt1cnt(&mut self) -> FLT1CNT_W { FLT1CNT_W { w: self } } #[doc = "Bit 1 - FLT1BLKS"] #[inline(always)] pub fn flt1blks(&mut self) -> FLT1BLKS_W { FLT1BLKS_W { w: self } } #[doc = "Bit 0 - FLT1BLKE"] #[inline(always)] pub fn flt1blke(&mut self) -> FLT1BLKE_W { FLT1BLKE_W { w: self } } }
#![allow(non_camel_case_types)] #![allow(dead_code)] use libc::{c_char, c_int, c_uint, c_void, size_t}; pub type c_bool = c_int; pub type csh = *const c_void; pub type cs_err = c_int; pub type cs_opt_type = c_int; #[repr(C)] pub struct cs_insn { pub id: c_uint, pub address: u64, pub size: u16, pub bytes: [u8; 16], pub mnemonic: [u8; 32], pub op_str: [u8; 160], pub detail: *const c_void, } #[link(name = "capstone")] extern "C" { pub fn cs_version(major: *mut c_int, minor: *mut c_int) -> c_uint; pub fn cs_support(query: c_int) -> c_bool; pub fn cs_open(arch: c_int, mode: c_int, handle: *mut csh) -> cs_err; pub fn cs_close(handle: *mut csh) -> cs_err; pub fn cs_option(handle: csh, _type: cs_opt_type, value: size_t) -> cs_err; pub fn cs_errno(handle: csh) -> cs_err; pub fn cs_strerror(code: cs_err) -> *const c_char; pub fn cs_disasm(handle: csh, code: *const u8, code_size: size_t, address: u64, count: size_t, insn: *mut *mut cs_insn) -> size_t; pub fn cs_free(insn: *mut cs_insn, count: size_t); pub fn cs_reg_name(handle: csh, reg_id: c_uint) -> *const c_char; pub fn cs_insn_name(handle: csh, insn_id: c_uint) -> *const c_char; pub fn cs_insn_group(handle: csh, insn: *mut cs_insn, group_id: c_uint) -> c_bool; pub fn cs_reg_read(handle: csh, insn: *mut cs_insn, reg_id: c_uint) -> c_bool; pub fn cs_reg_write(handle: csh, insn: *mut cs_insn, reg_id: c_uint) -> c_bool; pub fn cs_op_count(handle: csh, insn: *mut cs_insn, op_type: c_uint) -> c_int; pub fn cs_op_index(handle: csh, insn: *mut cs_insn, op_type: c_uint, position: c_uint) -> c_int; }
use wasm_bindgen::JsValue; use wasm_bindgen::prelude::*; #[wasm_bindgen] pub fn parse_golang_fmt_print(mut code: &str) -> Result<Vec<u8>, JsValue> { if code.starts_with('[') { code = &code[1..]; } if code.ends_with(']') { code = &code[..code.len() - 1]; } let str_forms = code.split(' '); let mut result = Vec::with_capacity(str_forms.clone().count()); for str_form in str_forms { let byte_form = str_form .parse::<u8>() .map_err(|_| JsValue::from("Parse golang fmt.print failed"))?; result.push(byte_form); } Ok(result) } #[wasm_bindgen] pub fn parse_hex_encoded(code: &str) -> Result<Vec<u8>, JsValue> { hex::decode(code).map_err(|_| JsValue::from("Invalid hex encoded")) } #[wasm_bindgen] pub fn parse_rust_print(mut code: &str) -> Result<Vec<u8>, JsValue> { if code.starts_with('[') { code = &code[1..]; } if code.ends_with(']') { code = &code[..code.len() - 1]; } let str_forms = code.split(',').map(|it| it.trim()); let mut result = Vec::with_capacity(str_forms.clone().count()); for str_form in str_forms { let byte_form = str_form .parse::<u8>() .map_err(|_| JsValue::from("Invalid rust print encoded"))?; result.push(byte_form); } Ok(result) } #[wasm_bindgen] pub fn parse_input(code: &str) -> Result<Vec<u8>, JsValue> { if let Ok(result) = parse_rust_print(code) { Ok(result) } else if let Ok(result) = parse_golang_fmt_print(code) { Ok(result) } else if let Ok(result) = parse_hex_encoded(code) { Ok(result) } else { Err(JsValue::from_str("Cannot parse input")) } } #[cfg(test)] mod test { use super::*; use crate::db_to_kv::parse_record; #[test] fn test_parse_golang_fmt_print() { let cases = vec![ ("68 66 58 49", "DB:1"), ("[84 97 98 108 101 58 53 51]", "Table:53"), ]; for (code, expected) in cases.into_iter() { let result = parse_golang_fmt_print(code).unwrap(); let str_form = String::from_utf8(result).unwrap(); assert_eq!(str_form, expected); } } #[test] fn test_decode_hex() { let expected = vec![ 116, 128, 0, 0, 0, 0, 0, 0, 53, 95, 114, 128, 0, 0, 0, 0, 0, 0, 1, ]; assert_eq!( parse_hex_encoded("7480000000000000355f728000000000000001").unwrap(), expected ) } }
use backend::x86::X86Platform; use backend::Platform; use error::CompileError; use std::env; use std::fmt::Display; use std::fs::File; use std::io::{BufWriter, Read, Write}; use std::path::Path; extern crate hashbrown; #[macro_use] extern crate lalrpop_util; extern crate term; extern crate unicode_xid; pub mod backend; pub mod collections; pub mod error; pub mod ident; pub mod intermediate; pub mod minijava; pub mod naming_context; fn error(error: CompileError, exit: i32) -> ! { error.report().unwrap(); // println!("{}", msg); std::process::exit(exit) } fn read_source(source: &str) -> std::io::Result<String> { let mut f = File::open(source)?; let mut s = String::new(); f.read_to_string(&mut s)?; Ok(s) } fn write_result(source: &str, ext: &str, code: &dyn Display) -> std::io::Result<()> { let file = match Path::new(source).file_name() { None => std::ffi::OsStr::new("a"), Some(file) => file, }; let s = Path::new(file).with_extension(ext); let file = File::create(s)?; let mut f = BufWriter::new(file); write!(f, "{}", code) } fn compile(file: &str) -> Result<(), error::CompileError> { let source = match read_source(&file) { Err(e) => { return Err(CompileError::new(&format!( "Cannot read input: {} ({})", file, e ))); } Ok(source) => source, }; let ast = minijava::parser::parse_prg(&source)?; let symbol_table = minijava::symbols::SymbolTable::new(&ast)?; minijava::typecheck::verify_prg(&symbol_table, &ast)?; let intermediate = { let translator = intermediate::Translator::<X86Platform>::new(&symbol_table); translator.process(&ast) }; let canonized = { let canonizer = intermediate::Canonizer::new(); canonizer.process(intermediate) }; let traced = { let tracer = intermediate::Tracer::new(); tracer.process(canonized) }; let mut code = X86Platform::code_gen(&traced); backend::regalloc::alloc::<X86Platform>(&mut code); if let Err(_) = write_result(file, "s", &code) { return Err(CompileError::new("Cannot write file")); } Ok(()) } fn main() { let mut args = env::args(); args.next(); // discard executable source for argument in args { match compile(&argument) { Err(e) => error(e, 1), Ok(()) => (), } } }
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)] #[cfg(feature = "UI_WebUI_Core")] pub mod Core; #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ActivatedDeferral(pub ::windows::core::IInspectable); impl ActivatedDeferral { pub fn Complete(&self) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this)).ok() } } } unsafe impl ::windows::core::RuntimeType for ActivatedDeferral { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.ActivatedDeferral;{c3bd1978-a431-49d8-a76a-395a4e03dcf3})"); } unsafe impl ::windows::core::Interface for ActivatedDeferral { type Vtable = IActivatedDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc3bd1978_a431_49d8_a76a_395a4e03dcf3); } impl ::windows::core::RuntimeName for ActivatedDeferral { const NAME: &'static str = "Windows.UI.WebUI.ActivatedDeferral"; } impl ::core::convert::From<ActivatedDeferral> for ::windows::core::IUnknown { fn from(value: ActivatedDeferral) -> Self { value.0 .0 } } impl ::core::convert::From<&ActivatedDeferral> for ::windows::core::IUnknown { fn from(value: &ActivatedDeferral) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ActivatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ActivatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<ActivatedDeferral> for ::windows::core::IInspectable { fn from(value: ActivatedDeferral) -> Self { value.0 } } impl ::core::convert::From<&ActivatedDeferral> for ::windows::core::IInspectable { fn from(value: &ActivatedDeferral) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for ActivatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a ActivatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ActivatedEventHandler(::windows::core::IUnknown); #[cfg(feature = "ApplicationModel_Activation")] impl ActivatedEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IActivatedEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = ActivatedEventHandler_box::<F> { vtable: &ActivatedEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs>>(&self, sender: Param0, eventargs: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), eventargs.into_param().abi()).ok() } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for ActivatedEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({50f1e730-c5d1-4b6b-9adb-8a11756be29c})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for ActivatedEventHandler { type Vtable = ActivatedEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x50f1e730_c5d1_4b6b_9adb_8a11756be29c); } #[cfg(feature = "ApplicationModel_Activation")] #[repr(C)] #[doc(hidden)] pub struct ActivatedEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, eventargs: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[cfg(feature = "ApplicationModel_Activation")] #[repr(C)] struct ActivatedEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IActivatedEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const ActivatedEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } #[cfg(feature = "ApplicationModel_Activation")] impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IActivatedEventArgs>) -> ::windows::core::Result<()> + 'static> ActivatedEventHandler_box<F> { const VTABLE: ActivatedEventHandler_abi = ActivatedEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<ActivatedEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, eventargs: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&eventargs as *const <super::super::ApplicationModel::Activation::IActivatedEventArgs as ::windows::core::Abi>::Abi as *const <super::super::ApplicationModel::Activation::IActivatedEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ActivatedOperation(pub ::windows::core::IInspectable); impl ActivatedOperation { pub fn GetDeferral(&self) -> ::windows::core::Result<ActivatedDeferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedDeferral>(result__) } } } unsafe impl ::windows::core::RuntimeType for ActivatedOperation { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.ActivatedOperation;{b6a0b4bc-c6ca-42fd-9818-71904e45fed7})"); } unsafe impl ::windows::core::Interface for ActivatedOperation { type Vtable = IActivatedOperation_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb6a0b4bc_c6ca_42fd_9818_71904e45fed7); } impl ::windows::core::RuntimeName for ActivatedOperation { const NAME: &'static str = "Windows.UI.WebUI.ActivatedOperation"; } impl ::core::convert::From<ActivatedOperation> for ::windows::core::IUnknown { fn from(value: ActivatedOperation) -> Self { value.0 .0 } } impl ::core::convert::From<&ActivatedOperation> for ::windows::core::IUnknown { fn from(value: &ActivatedOperation) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ActivatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ActivatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<ActivatedOperation> for ::windows::core::IInspectable { fn from(value: ActivatedOperation) -> Self { value.0 } } impl ::core::convert::From<&ActivatedOperation> for ::windows::core::IInspectable { fn from(value: &ActivatedOperation) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for ActivatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a ActivatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct BackgroundActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl BackgroundActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Background"))] pub fn TaskInstance(&self) -> ::windows::core::Result<super::super::ApplicationModel::Background::IBackgroundTaskInstance> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for BackgroundActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.BackgroundActivatedEventArgs;{ab14bee0-e760-440e-a91c-44796de3a92d})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for BackgroundActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xab14bee0_e760_440e_a91c_44796de3a92d); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for BackgroundActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.BackgroundActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<BackgroundActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: BackgroundActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&BackgroundActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &BackgroundActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<BackgroundActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: BackgroundActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&BackgroundActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &BackgroundActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<BackgroundActivatedEventArgs> for super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs { fn from(value: BackgroundActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&BackgroundActivatedEventArgs> for super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs { fn from(value: &BackgroundActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs> for BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs> for &BackgroundActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for BackgroundActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for BackgroundActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct BackgroundActivatedEventHandler(::windows::core::IUnknown); #[cfg(feature = "ApplicationModel_Activation")] impl BackgroundActivatedEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = BackgroundActivatedEventHandler_box::<F> { vtable: &BackgroundActivatedEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs>>(&self, sender: Param0, eventargs: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), eventargs.into_param().abi()).ok() } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for BackgroundActivatedEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({edb19fbb-0761-47cc-9a77-24d7072965ca})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for BackgroundActivatedEventHandler { type Vtable = BackgroundActivatedEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xedb19fbb_0761_47cc_9a77_24d7072965ca); } #[cfg(feature = "ApplicationModel_Activation")] #[repr(C)] #[doc(hidden)] pub struct BackgroundActivatedEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, eventargs: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[cfg(feature = "ApplicationModel_Activation")] #[repr(C)] struct BackgroundActivatedEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const BackgroundActivatedEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } #[cfg(feature = "ApplicationModel_Activation")] impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs>) -> ::windows::core::Result<()> + 'static> BackgroundActivatedEventHandler_box<F> { const VTABLE: BackgroundActivatedEventHandler_abi = BackgroundActivatedEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<BackgroundActivatedEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, eventargs: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&eventargs as *const <super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs as ::windows::core::Abi>::Abi as *const <super::super::ApplicationModel::Activation::IBackgroundActivatedEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct EnteredBackgroundEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel")] impl EnteredBackgroundEventArgs { #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn GetDeferral(&self) -> ::windows::core::Result<super::super::Foundation::Deferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Deferral>(result__) } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for EnteredBackgroundEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.EnteredBackgroundEventArgs;{f722dcc2-9827-403d-aaed-ecca9ac17398})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for EnteredBackgroundEventArgs { type Vtable = super::super::ApplicationModel::IEnteredBackgroundEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf722dcc2_9827_403d_aaed_ecca9ac17398); } #[cfg(feature = "ApplicationModel")] impl ::windows::core::RuntimeName for EnteredBackgroundEventArgs { const NAME: &'static str = "Windows.UI.WebUI.EnteredBackgroundEventArgs"; } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<EnteredBackgroundEventArgs> for ::windows::core::IUnknown { fn from(value: EnteredBackgroundEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&EnteredBackgroundEventArgs> for ::windows::core::IUnknown { fn from(value: &EnteredBackgroundEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<EnteredBackgroundEventArgs> for ::windows::core::IInspectable { fn from(value: EnteredBackgroundEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&EnteredBackgroundEventArgs> for ::windows::core::IInspectable { fn from(value: &EnteredBackgroundEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<EnteredBackgroundEventArgs> for super::super::ApplicationModel::IEnteredBackgroundEventArgs { fn from(value: EnteredBackgroundEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&EnteredBackgroundEventArgs> for super::super::ApplicationModel::IEnteredBackgroundEventArgs { fn from(value: &EnteredBackgroundEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::IEnteredBackgroundEventArgs> for EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::IEnteredBackgroundEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::IEnteredBackgroundEventArgs> for &EnteredBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::IEnteredBackgroundEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] unsafe impl ::core::marker::Send for EnteredBackgroundEventArgs {} #[cfg(feature = "ApplicationModel")] unsafe impl ::core::marker::Sync for EnteredBackgroundEventArgs {} #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct EnteredBackgroundEventHandler(::windows::core::IUnknown); #[cfg(feature = "ApplicationModel")] impl EnteredBackgroundEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::IEnteredBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = EnteredBackgroundEventHandler_box::<F> { vtable: &EnteredBackgroundEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } #[cfg(feature = "ApplicationModel")] pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, super::super::ApplicationModel::IEnteredBackgroundEventArgs>>(&self, sender: Param0, e: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), e.into_param().abi()).ok() } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for EnteredBackgroundEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({2b09a173-b68e-4def-88c1-8de84e5aab2f})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for EnteredBackgroundEventHandler { type Vtable = EnteredBackgroundEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2b09a173_b68e_4def_88c1_8de84e5aab2f); } #[cfg(feature = "ApplicationModel")] #[repr(C)] #[doc(hidden)] pub struct EnteredBackgroundEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[cfg(feature = "ApplicationModel")] #[repr(C)] struct EnteredBackgroundEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::IEnteredBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const EnteredBackgroundEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } #[cfg(feature = "ApplicationModel")] impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::IEnteredBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static> EnteredBackgroundEventHandler_box<F> { const VTABLE: EnteredBackgroundEventHandler_abi = EnteredBackgroundEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<EnteredBackgroundEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&e as *const <super::super::ApplicationModel::IEnteredBackgroundEventArgs as ::windows::core::Abi>::Abi as *const <super::super::ApplicationModel::IEnteredBackgroundEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct HtmlPrintDocumentSource(pub ::windows::core::IInspectable); impl HtmlPrintDocumentSource { pub fn Content(&self) -> ::windows::core::Result<PrintContent> { let this = self; unsafe { let mut result__: PrintContent = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<PrintContent>(result__) } } pub fn SetContent(&self, value: PrintContent) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value).ok() } } pub fn LeftMargin(&self) -> ::windows::core::Result<f32> { let this = self; unsafe { let mut result__: f32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f32>(result__) } } pub fn SetLeftMargin(&self, value: f32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn TopMargin(&self) -> ::windows::core::Result<f32> { let this = self; unsafe { let mut result__: f32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f32>(result__) } } pub fn SetTopMargin(&self, value: f32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value).ok() } } pub fn RightMargin(&self) -> ::windows::core::Result<f32> { let this = self; unsafe { let mut result__: f32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f32>(result__) } } pub fn SetRightMargin(&self, value: f32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), value).ok() } } pub fn BottomMargin(&self) -> ::windows::core::Result<f32> { let this = self; unsafe { let mut result__: f32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f32>(result__) } } pub fn SetBottomMargin(&self, value: f32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), value).ok() } } pub fn EnableHeaderFooter(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).16)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn SetEnableHeaderFooter(&self, value: bool) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).17)(::core::mem::transmute_copy(this), value).ok() } } pub fn ShrinkToFit(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).18)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn SetShrinkToFit(&self, value: bool) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).19)(::core::mem::transmute_copy(this), value).ok() } } pub fn PercentScale(&self) -> ::windows::core::Result<f32> { let this = self; unsafe { let mut result__: f32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).20)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f32>(result__) } } pub fn SetPercentScale(&self, scalepercent: f32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).21)(::core::mem::transmute_copy(this), scalepercent).ok() } } pub fn PageRange(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).22)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn TrySetPageRange<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(&self, strpagerange: Param0) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).23)(::core::mem::transmute_copy(this), strpagerange.into_param().abi(), &mut result__).from_abi::<bool>(result__) } } #[cfg(feature = "Foundation")] pub fn Close(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Foundation::IClosable>(self)?; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this)).ok() } } } unsafe impl ::windows::core::RuntimeType for HtmlPrintDocumentSource { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.HtmlPrintDocumentSource;{cea6469a-0e05-467a-abc9-36ec1d4cdcb6})"); } unsafe impl ::windows::core::Interface for HtmlPrintDocumentSource { type Vtable = IHtmlPrintDocumentSource_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcea6469a_0e05_467a_abc9_36ec1d4cdcb6); } impl ::windows::core::RuntimeName for HtmlPrintDocumentSource { const NAME: &'static str = "Windows.UI.WebUI.HtmlPrintDocumentSource"; } impl ::core::convert::From<HtmlPrintDocumentSource> for ::windows::core::IUnknown { fn from(value: HtmlPrintDocumentSource) -> Self { value.0 .0 } } impl ::core::convert::From<&HtmlPrintDocumentSource> for ::windows::core::IUnknown { fn from(value: &HtmlPrintDocumentSource) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<HtmlPrintDocumentSource> for ::windows::core::IInspectable { fn from(value: HtmlPrintDocumentSource) -> Self { value.0 } } impl ::core::convert::From<&HtmlPrintDocumentSource> for ::windows::core::IInspectable { fn from(value: &HtmlPrintDocumentSource) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Foundation")] impl ::core::convert::TryFrom<HtmlPrintDocumentSource> for super::super::Foundation::IClosable { type Error = ::windows::core::Error; fn try_from(value: HtmlPrintDocumentSource) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "Foundation")] impl ::core::convert::TryFrom<&HtmlPrintDocumentSource> for super::super::Foundation::IClosable { type Error = ::windows::core::Error; fn try_from(value: &HtmlPrintDocumentSource) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "Foundation")] impl<'a> ::windows::core::IntoParam<'a, super::super::Foundation::IClosable> for HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, super::super::Foundation::IClosable> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "Foundation")] impl<'a> ::windows::core::IntoParam<'a, super::super::Foundation::IClosable> for &HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, super::super::Foundation::IClosable> { ::core::convert::TryInto::<super::super::Foundation::IClosable>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "Graphics_Printing")] impl ::core::convert::TryFrom<HtmlPrintDocumentSource> for super::super::Graphics::Printing::IPrintDocumentSource { type Error = ::windows::core::Error; fn try_from(value: HtmlPrintDocumentSource) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "Graphics_Printing")] impl ::core::convert::TryFrom<&HtmlPrintDocumentSource> for super::super::Graphics::Printing::IPrintDocumentSource { type Error = ::windows::core::Error; fn try_from(value: &HtmlPrintDocumentSource) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "Graphics_Printing")] impl<'a> ::windows::core::IntoParam<'a, super::super::Graphics::Printing::IPrintDocumentSource> for HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, super::super::Graphics::Printing::IPrintDocumentSource> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "Graphics_Printing")] impl<'a> ::windows::core::IntoParam<'a, super::super::Graphics::Printing::IPrintDocumentSource> for &HtmlPrintDocumentSource { fn into_param(self) -> ::windows::core::Param<'a, super::super::Graphics::Printing::IPrintDocumentSource> { ::core::convert::TryInto::<super::super::Graphics::Printing::IPrintDocumentSource>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } unsafe impl ::core::marker::Send for HtmlPrintDocumentSource {} unsafe impl ::core::marker::Sync for HtmlPrintDocumentSource {} #[repr(transparent)] #[doc(hidden)] pub struct IActivatedDeferral(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IActivatedDeferral { type Vtable = IActivatedDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc3bd1978_a431_49d8_a76a_395a4e03dcf3); } #[repr(C)] #[doc(hidden)] pub struct IActivatedDeferral_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IActivatedEventArgsDeferral(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IActivatedEventArgsDeferral { type Vtable = IActivatedEventArgsDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xca6d5f74_63c2_44a6_b97b_d9a03c20bc9b); } impl IActivatedEventArgsDeferral { pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } unsafe impl ::windows::core::RuntimeType for IActivatedEventArgsDeferral { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"{ca6d5f74-63c2-44a6-b97b-d9a03c20bc9b}"); } impl ::core::convert::From<IActivatedEventArgsDeferral> for ::windows::core::IUnknown { fn from(value: IActivatedEventArgsDeferral) -> Self { value.0 .0 } } impl ::core::convert::From<&IActivatedEventArgsDeferral> for ::windows::core::IUnknown { fn from(value: &IActivatedEventArgsDeferral) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IActivatedEventArgsDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IActivatedEventArgsDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<IActivatedEventArgsDeferral> for ::windows::core::IInspectable { fn from(value: IActivatedEventArgsDeferral) -> Self { value.0 } } impl ::core::convert::From<&IActivatedEventArgsDeferral> for ::windows::core::IInspectable { fn from(value: &IActivatedEventArgsDeferral) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for IActivatedEventArgsDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a IActivatedEventArgsDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IActivatedEventArgsDeferral_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IActivatedOperation(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IActivatedOperation { type Vtable = IActivatedOperation_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb6a0b4bc_c6ca_42fd_9818_71904e45fed7); } #[repr(C)] #[doc(hidden)] pub struct IActivatedOperation_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IHtmlPrintDocumentSource(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IHtmlPrintDocumentSource { type Vtable = IHtmlPrintDocumentSource_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcea6469a_0e05_467a_abc9_36ec1d4cdcb6); } #[repr(C)] #[doc(hidden)] pub struct IHtmlPrintDocumentSource_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut PrintContent) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: PrintContent) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scalepercent: f32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::core::mem::ManuallyDrop<::windows::core::HSTRING>) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strpagerange: ::core::mem::ManuallyDrop<::windows::core::HSTRING>, result__: *mut bool) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct INewWebUIViewCreatedEventArgs(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for INewWebUIViewCreatedEventArgs { type Vtable = INewWebUIViewCreatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe8e1b216_be2b_4c9e_85e7_083143ec4be7); } #[repr(C)] #[doc(hidden)] pub struct INewWebUIViewCreatedEventArgs_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "ApplicationModel_Activation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "ApplicationModel_Activation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut bool) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIActivationStatics(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIActivationStatics { type Vtable = IWebUIActivationStatics_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x351b86bd_43b3_482b_85db_35d87b517ad9); } #[repr(C)] #[doc(hidden)] pub struct IWebUIActivationStatics_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel_Activation", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIActivationStatics2(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIActivationStatics2 { type Vtable = IWebUIActivationStatics2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc8e88696_4d78_4aa4_8f06_2a9eadc6c40a); } #[repr(C)] #[doc(hidden)] pub struct IWebUIActivationStatics2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: bool) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIActivationStatics3(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIActivationStatics3 { type Vtable = IWebUIActivationStatics3_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x91abb686_1af5_4445_b49f_9459f40fc8de); } #[repr(C)] #[doc(hidden)] pub struct IWebUIActivationStatics3_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "ApplicationModel_Core", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, launcharguments: ::core::mem::ManuallyDrop<::windows::core::HSTRING>, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel_Core", feature = "Foundation")))] usize, #[cfg(all(feature = "ApplicationModel_Core", feature = "Foundation", feature = "System"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, user: ::windows::core::RawPtr, launcharguments: ::core::mem::ManuallyDrop<::windows::core::HSTRING>, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel_Core", feature = "Foundation", feature = "System")))] usize, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIActivationStatics4(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIActivationStatics4 { type Vtable = IWebUIActivationStatics4_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5e391429_183f_478d_8a25_67f80d03935b); } #[repr(C)] #[doc(hidden)] pub struct IWebUIActivationStatics4_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel_Activation", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IWebUIBackgroundTaskInstance(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIBackgroundTaskInstance { type Vtable = IWebUIBackgroundTaskInstance_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x23f12c25_e2f7_4741_bc9c_394595de24dc); } impl IWebUIBackgroundTaskInstance { pub fn Succeeded(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn SetSucceeded(&self, succeeded: bool) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), succeeded).ok() } } } unsafe impl ::windows::core::RuntimeType for IWebUIBackgroundTaskInstance { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"{23f12c25-e2f7-4741-bc9c-394595de24dc}"); } impl ::core::convert::From<IWebUIBackgroundTaskInstance> for ::windows::core::IUnknown { fn from(value: IWebUIBackgroundTaskInstance) -> Self { value.0 .0 } } impl ::core::convert::From<&IWebUIBackgroundTaskInstance> for ::windows::core::IUnknown { fn from(value: &IWebUIBackgroundTaskInstance) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IWebUIBackgroundTaskInstance { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IWebUIBackgroundTaskInstance { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<IWebUIBackgroundTaskInstance> for ::windows::core::IInspectable { fn from(value: IWebUIBackgroundTaskInstance) -> Self { value.0 } } impl ::core::convert::From<&IWebUIBackgroundTaskInstance> for ::windows::core::IInspectable { fn from(value: &IWebUIBackgroundTaskInstance) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for IWebUIBackgroundTaskInstance { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a IWebUIBackgroundTaskInstance { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IWebUIBackgroundTaskInstance_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, succeeded: bool) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIBackgroundTaskInstanceStatics(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIBackgroundTaskInstanceStatics { type Vtable = IWebUIBackgroundTaskInstanceStatics_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9c7a5291_19ae_4ca3_b94b_fe4ec744a740); } #[repr(C)] #[doc(hidden)] pub struct IWebUIBackgroundTaskInstanceStatics_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUINavigatedDeferral(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUINavigatedDeferral { type Vtable = IWebUINavigatedDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd804204d_831f_46e2_b432_3afce211f962); } #[repr(C)] #[doc(hidden)] pub struct IWebUINavigatedDeferral_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IWebUINavigatedEventArgs(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUINavigatedEventArgs { type Vtable = IWebUINavigatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa75841b8_2499_4030_a69d_15d2d9cfe524); } impl IWebUINavigatedEventArgs { pub fn NavigatedOperation(&self) -> ::windows::core::Result<WebUINavigatedOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<WebUINavigatedOperation>(result__) } } } unsafe impl ::windows::core::RuntimeType for IWebUINavigatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"{a75841b8-2499-4030-a69d-15d2d9cfe524}"); } impl ::core::convert::From<IWebUINavigatedEventArgs> for ::windows::core::IUnknown { fn from(value: IWebUINavigatedEventArgs) -> Self { value.0 .0 } } impl ::core::convert::From<&IWebUINavigatedEventArgs> for ::windows::core::IUnknown { fn from(value: &IWebUINavigatedEventArgs) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IWebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IWebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<IWebUINavigatedEventArgs> for ::windows::core::IInspectable { fn from(value: IWebUINavigatedEventArgs) -> Self { value.0 } } impl ::core::convert::From<&IWebUINavigatedEventArgs> for ::windows::core::IInspectable { fn from(value: &IWebUINavigatedEventArgs) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for IWebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a IWebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IWebUINavigatedEventArgs_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUINavigatedOperation(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUINavigatedOperation { type Vtable = IWebUINavigatedOperation_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7a965f08_8182_4a89_ab67_8492e8750d4b); } #[repr(C)] #[doc(hidden)] pub struct IWebUINavigatedOperation_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIView(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIView { type Vtable = IWebUIView_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6783f64f_52da_4fd7_be69_8ef6284b423c); } #[repr(C)] #[doc(hidden)] pub struct IWebUIView_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, handler: ::windows::core::RawPtr, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "ApplicationModel_Activation", feature = "Foundation")))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: super::super::Foundation::EventRegistrationToken) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut bool) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: bool) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IWebUIViewStatics(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IWebUIViewStatics { type Vtable = IWebUIViewStatics_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb591e668_8e59_44f9_8803_1b24c9149d30); } #[repr(C)] #[doc(hidden)] pub struct IWebUIViewStatics_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, #[cfg(feature = "Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, uri: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation"))] usize, ); #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct LeavingBackgroundEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel")] impl LeavingBackgroundEventArgs { #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn GetDeferral(&self) -> ::windows::core::Result<super::super::Foundation::Deferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Deferral>(result__) } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for LeavingBackgroundEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.LeavingBackgroundEventArgs;{39c6ec9a-ae6e-46f9-a07a-cfc23f88733e})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for LeavingBackgroundEventArgs { type Vtable = super::super::ApplicationModel::ILeavingBackgroundEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x39c6ec9a_ae6e_46f9_a07a_cfc23f88733e); } #[cfg(feature = "ApplicationModel")] impl ::windows::core::RuntimeName for LeavingBackgroundEventArgs { const NAME: &'static str = "Windows.UI.WebUI.LeavingBackgroundEventArgs"; } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<LeavingBackgroundEventArgs> for ::windows::core::IUnknown { fn from(value: LeavingBackgroundEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&LeavingBackgroundEventArgs> for ::windows::core::IUnknown { fn from(value: &LeavingBackgroundEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<LeavingBackgroundEventArgs> for ::windows::core::IInspectable { fn from(value: LeavingBackgroundEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&LeavingBackgroundEventArgs> for ::windows::core::IInspectable { fn from(value: &LeavingBackgroundEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<LeavingBackgroundEventArgs> for super::super::ApplicationModel::ILeavingBackgroundEventArgs { fn from(value: LeavingBackgroundEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&LeavingBackgroundEventArgs> for super::super::ApplicationModel::ILeavingBackgroundEventArgs { fn from(value: &LeavingBackgroundEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ILeavingBackgroundEventArgs> for LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ILeavingBackgroundEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ILeavingBackgroundEventArgs> for &LeavingBackgroundEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ILeavingBackgroundEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] unsafe impl ::core::marker::Send for LeavingBackgroundEventArgs {} #[cfg(feature = "ApplicationModel")] unsafe impl ::core::marker::Sync for LeavingBackgroundEventArgs {} #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct LeavingBackgroundEventHandler(::windows::core::IUnknown); #[cfg(feature = "ApplicationModel")] impl LeavingBackgroundEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ILeavingBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = LeavingBackgroundEventHandler_box::<F> { vtable: &LeavingBackgroundEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } #[cfg(feature = "ApplicationModel")] pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, super::super::ApplicationModel::ILeavingBackgroundEventArgs>>(&self, sender: Param0, e: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), e.into_param().abi()).ok() } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for LeavingBackgroundEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({00b4ccd9-7a9c-4b6b-9ac4-13474f268bc4})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for LeavingBackgroundEventHandler { type Vtable = LeavingBackgroundEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00b4ccd9_7a9c_4b6b_9ac4_13474f268bc4); } #[cfg(feature = "ApplicationModel")] #[repr(C)] #[doc(hidden)] pub struct LeavingBackgroundEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[cfg(feature = "ApplicationModel")] #[repr(C)] struct LeavingBackgroundEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ILeavingBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const LeavingBackgroundEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } #[cfg(feature = "ApplicationModel")] impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ILeavingBackgroundEventArgs>) -> ::windows::core::Result<()> + 'static> LeavingBackgroundEventHandler_box<F> { const VTABLE: LeavingBackgroundEventHandler_abi = LeavingBackgroundEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<LeavingBackgroundEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&e as *const <super::super::ApplicationModel::ILeavingBackgroundEventArgs as ::windows::core::Abi>::Abi as *const <super::super::ApplicationModel::ILeavingBackgroundEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct NavigatedEventHandler(::windows::core::IUnknown); impl NavigatedEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<IWebUINavigatedEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = NavigatedEventHandler_box::<F> { vtable: &NavigatedEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, IWebUINavigatedEventArgs>>(&self, sender: Param0, e: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), e.into_param().abi()).ok() } } } unsafe impl ::windows::core::RuntimeType for NavigatedEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({7af46fe6-40ca-4e49-a7d6-dbdb330cd1a3})"); } unsafe impl ::windows::core::Interface for NavigatedEventHandler { type Vtable = NavigatedEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7af46fe6_40ca_4e49_a7d6_dbdb330cd1a3); } #[repr(C)] #[doc(hidden)] pub struct NavigatedEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(C)] struct NavigatedEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<IWebUINavigatedEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const NavigatedEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<IWebUINavigatedEventArgs>) -> ::windows::core::Result<()> + 'static> NavigatedEventHandler_box<F> { const VTABLE: NavigatedEventHandler_abi = NavigatedEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<NavigatedEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&e as *const <IWebUINavigatedEventArgs as ::windows::core::Abi>::Abi as *const <IWebUINavigatedEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct NewWebUIViewCreatedEventArgs(pub ::windows::core::IInspectable); impl NewWebUIViewCreatedEventArgs { pub fn WebUIView(&self) -> ::windows::core::Result<WebUIView> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<WebUIView>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ActivatedEventArgs(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::IActivatedEventArgs> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(result__) } } pub fn HasPendingNavigate(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } #[cfg(feature = "Foundation")] pub fn GetDeferral(&self) -> ::windows::core::Result<super::super::Foundation::Deferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Deferral>(result__) } } } unsafe impl ::windows::core::RuntimeType for NewWebUIViewCreatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.NewWebUIViewCreatedEventArgs;{e8e1b216-be2b-4c9e-85e7-083143ec4be7})"); } unsafe impl ::windows::core::Interface for NewWebUIViewCreatedEventArgs { type Vtable = INewWebUIViewCreatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe8e1b216_be2b_4c9e_85e7_083143ec4be7); } impl ::windows::core::RuntimeName for NewWebUIViewCreatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.NewWebUIViewCreatedEventArgs"; } impl ::core::convert::From<NewWebUIViewCreatedEventArgs> for ::windows::core::IUnknown { fn from(value: NewWebUIViewCreatedEventArgs) -> Self { value.0 .0 } } impl ::core::convert::From<&NewWebUIViewCreatedEventArgs> for ::windows::core::IUnknown { fn from(value: &NewWebUIViewCreatedEventArgs) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for NewWebUIViewCreatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a NewWebUIViewCreatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<NewWebUIViewCreatedEventArgs> for ::windows::core::IInspectable { fn from(value: NewWebUIViewCreatedEventArgs) -> Self { value.0 } } impl ::core::convert::From<&NewWebUIViewCreatedEventArgs> for ::windows::core::IInspectable { fn from(value: &NewWebUIViewCreatedEventArgs) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for NewWebUIViewCreatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a NewWebUIViewCreatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PrintContent(pub i32); impl PrintContent { pub const AllPages: PrintContent = PrintContent(0i32); pub const CurrentPage: PrintContent = PrintContent(1i32); pub const CustomPageRange: PrintContent = PrintContent(2i32); pub const CurrentSelection: PrintContent = PrintContent(3i32); } impl ::core::convert::From<i32> for PrintContent { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PrintContent { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for PrintContent { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.WebUI.PrintContent;i4)"); } impl ::windows::core::DefaultType for PrintContent { type DefaultType = Self; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ResumingEventHandler(::windows::core::IUnknown); impl ResumingEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = ResumingEventHandler_box::<F> { vtable: &ResumingEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>>(&self, sender: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi()).ok() } } } unsafe impl ::windows::core::RuntimeType for ResumingEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({26599ba9-a22d-4806-a728-acadc1d075fa})"); } unsafe impl ::windows::core::Interface for ResumingEventHandler { type Vtable = ResumingEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x26599ba9_a22d_4806_a728_acadc1d075fa); } #[repr(C)] #[doc(hidden)] pub struct ResumingEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(C)] struct ResumingEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>) -> ::windows::core::Result<()> + 'static> { vtable: *const ResumingEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>) -> ::windows::core::Result<()> + 'static> ResumingEventHandler_box<F> { const VTABLE: ResumingEventHandler_abi = ResumingEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<ResumingEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)(&*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType)).into() } } #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct SuspendingDeferral(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel")] impl SuspendingDeferral { #[cfg(feature = "ApplicationModel")] pub fn Complete(&self) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this)).ok() } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for SuspendingDeferral { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.SuspendingDeferral;{59140509-8bc9-4eb4-b636-dabdc4f46f66})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for SuspendingDeferral { type Vtable = super::super::ApplicationModel::ISuspendingDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x59140509_8bc9_4eb4_b636_dabdc4f46f66); } #[cfg(feature = "ApplicationModel")] impl ::windows::core::RuntimeName for SuspendingDeferral { const NAME: &'static str = "Windows.UI.WebUI.SuspendingDeferral"; } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingDeferral> for ::windows::core::IUnknown { fn from(value: SuspendingDeferral) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingDeferral> for ::windows::core::IUnknown { fn from(value: &SuspendingDeferral) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingDeferral> for ::windows::core::IInspectable { fn from(value: SuspendingDeferral) -> Self { value.0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingDeferral> for ::windows::core::IInspectable { fn from(value: &SuspendingDeferral) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingDeferral> for super::super::ApplicationModel::ISuspendingDeferral { fn from(value: SuspendingDeferral) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingDeferral> for super::super::ApplicationModel::ISuspendingDeferral { fn from(value: &SuspendingDeferral) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingDeferral> for SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingDeferral> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingDeferral> for &SuspendingDeferral { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingDeferral> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct SuspendingEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel")] impl SuspendingEventArgs { #[cfg(feature = "ApplicationModel")] pub fn SuspendingOperation(&self) -> ::windows::core::Result<super::super::ApplicationModel::SuspendingOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::SuspendingOperation>(result__) } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for SuspendingEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.SuspendingEventArgs;{96061c05-2dba-4d08-b0bd-2b30a131c6aa})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for SuspendingEventArgs { type Vtable = super::super::ApplicationModel::ISuspendingEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x96061c05_2dba_4d08_b0bd_2b30a131c6aa); } #[cfg(feature = "ApplicationModel")] impl ::windows::core::RuntimeName for SuspendingEventArgs { const NAME: &'static str = "Windows.UI.WebUI.SuspendingEventArgs"; } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingEventArgs> for ::windows::core::IUnknown { fn from(value: SuspendingEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingEventArgs> for ::windows::core::IUnknown { fn from(value: &SuspendingEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingEventArgs> for ::windows::core::IInspectable { fn from(value: SuspendingEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingEventArgs> for ::windows::core::IInspectable { fn from(value: &SuspendingEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingEventArgs> for super::super::ApplicationModel::ISuspendingEventArgs { fn from(value: SuspendingEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingEventArgs> for super::super::ApplicationModel::ISuspendingEventArgs { fn from(value: &SuspendingEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingEventArgs> for SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingEventArgs> for &SuspendingEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct SuspendingEventHandler(::windows::core::IUnknown); #[cfg(feature = "ApplicationModel")] impl SuspendingEventHandler { pub fn new<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ISuspendingEventArgs>) -> ::windows::core::Result<()> + 'static>(invoke: F) -> Self { let com = SuspendingEventHandler_box::<F> { vtable: &SuspendingEventHandler_box::<F>::VTABLE, count: ::windows::core::RefCount::new(1), invoke, }; unsafe { core::mem::transmute(::windows::core::alloc::boxed::Box::new(com)) } } #[cfg(feature = "ApplicationModel")] pub fn Invoke<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IInspectable>, Param1: ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingEventArgs>>(&self, sender: Param0, e: Param1) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).3)(::core::mem::transmute_copy(this), sender.into_param().abi(), e.into_param().abi()).ok() } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for SuspendingEventHandler { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"delegate({509c429c-78e2-4883-abc8-8960dcde1b5c})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for SuspendingEventHandler { type Vtable = SuspendingEventHandler_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x509c429c_78e2_4883_abc8_8960dcde1b5c); } #[cfg(feature = "ApplicationModel")] #[repr(C)] #[doc(hidden)] pub struct SuspendingEventHandler_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[cfg(feature = "ApplicationModel")] #[repr(C)] struct SuspendingEventHandler_box<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ISuspendingEventArgs>) -> ::windows::core::Result<()> + 'static> { vtable: *const SuspendingEventHandler_abi, invoke: F, count: ::windows::core::RefCount, } #[cfg(feature = "ApplicationModel")] impl<F: FnMut(&::core::option::Option<::windows::core::IInspectable>, &::core::option::Option<super::super::ApplicationModel::ISuspendingEventArgs>) -> ::windows::core::Result<()> + 'static> SuspendingEventHandler_box<F> { const VTABLE: SuspendingEventHandler_abi = SuspendingEventHandler_abi(Self::QueryInterface, Self::AddRef, Self::Release, Self::Invoke); unsafe extern "system" fn QueryInterface(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; *interface = if iid == &<SuspendingEventHandler as ::windows::core::Interface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::Interface>::IID || iid == &<::windows::core::IAgileObject as ::windows::core::Interface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() }; if (*interface).is_null() { ::windows::core::HRESULT(0x8000_4002) } else { (*this).count.add_ref(); ::windows::core::HRESULT(0) } } unsafe extern "system" fn AddRef(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; (*this).count.add_ref() } unsafe extern "system" fn Release(this: ::windows::core::RawPtr) -> u32 { let this = this as *mut ::windows::core::RawPtr as *mut Self; let remaining = (*this).count.release(); if remaining == 0 { ::windows::core::alloc::boxed::Box::from_raw(this); } remaining } unsafe extern "system" fn Invoke(this: ::windows::core::RawPtr, sender: ::windows::core::RawPtr, e: ::windows::core::RawPtr) -> ::windows::core::HRESULT { let this = this as *mut ::windows::core::RawPtr as *mut Self; ((*this).invoke)( &*(&sender as *const <::windows::core::IInspectable as ::windows::core::Abi>::Abi as *const <::windows::core::IInspectable as ::windows::core::DefaultType>::DefaultType), &*(&e as *const <super::super::ApplicationModel::ISuspendingEventArgs as ::windows::core::Abi>::Abi as *const <super::super::ApplicationModel::ISuspendingEventArgs as ::windows::core::DefaultType>::DefaultType), ) .into() } } #[cfg(feature = "ApplicationModel")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct SuspendingOperation(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel")] impl SuspendingOperation { #[cfg(feature = "ApplicationModel")] pub fn GetDeferral(&self) -> ::windows::core::Result<super::super::ApplicationModel::SuspendingDeferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::SuspendingDeferral>(result__) } } #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn Deadline(&self) -> ::windows::core::Result<super::super::Foundation::DateTime> { let this = self; unsafe { let mut result__: super::super::Foundation::DateTime = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::DateTime>(result__) } } } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::RuntimeType for SuspendingOperation { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.SuspendingOperation;{9da4ca41-20e1-4e9b-9f65-a9f435340c3a})"); } #[cfg(feature = "ApplicationModel")] unsafe impl ::windows::core::Interface for SuspendingOperation { type Vtable = super::super::ApplicationModel::ISuspendingOperation_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9da4ca41_20e1_4e9b_9f65_a9f435340c3a); } #[cfg(feature = "ApplicationModel")] impl ::windows::core::RuntimeName for SuspendingOperation { const NAME: &'static str = "Windows.UI.WebUI.SuspendingOperation"; } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingOperation> for ::windows::core::IUnknown { fn from(value: SuspendingOperation) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingOperation> for ::windows::core::IUnknown { fn from(value: &SuspendingOperation) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingOperation> for ::windows::core::IInspectable { fn from(value: SuspendingOperation) -> Self { value.0 } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingOperation> for ::windows::core::IInspectable { fn from(value: &SuspendingOperation) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<SuspendingOperation> for super::super::ApplicationModel::ISuspendingOperation { fn from(value: SuspendingOperation) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel")] impl ::core::convert::From<&SuspendingOperation> for super::super::ApplicationModel::ISuspendingOperation { fn from(value: &SuspendingOperation) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingOperation> for SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingOperation> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::ISuspendingOperation> for &SuspendingOperation { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::ISuspendingOperation> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } pub struct WebUIApplication {} impl WebUIApplication { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn Activated<'a, Param0: ::windows::core::IntoParam<'a, ActivatedEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveActivated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics(|this| unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn Suspending<'a, Param0: ::windows::core::IntoParam<'a, SuspendingEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveSuspending<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics(|this| unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(feature = "Foundation")] pub fn Resuming<'a, Param0: ::windows::core::IntoParam<'a, ResumingEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveResuming<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics(|this| unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(feature = "Foundation")] pub fn Navigated<'a, Param0: ::windows::core::IntoParam<'a, NavigatedEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveNavigated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics(|this| unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn LeavingBackground<'a, Param0: ::windows::core::IntoParam<'a, LeavingBackgroundEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics2(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveLeavingBackground<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics2(|this| unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(all(feature = "ApplicationModel", feature = "Foundation"))] pub fn EnteredBackground<'a, Param0: ::windows::core::IntoParam<'a, EnteredBackgroundEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics2(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveEnteredBackground<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics2(|this| unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } pub fn EnablePrelaunch(value: bool) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics2(|this| unsafe { (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), value).ok() }) } #[cfg(all(feature = "ApplicationModel_Core", feature = "Foundation"))] pub fn RequestRestartAsync<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(launcharguments: Param0) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::Core::AppRestartFailureReason>> { Self::IWebUIActivationStatics3(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), launcharguments.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::Core::AppRestartFailureReason>>(result__) }) } #[cfg(all(feature = "ApplicationModel_Core", feature = "Foundation", feature = "System"))] pub fn RequestRestartForUserAsync<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::User>, Param1: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(user: Param0, launcharguments: Param1) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::Core::AppRestartFailureReason>> { Self::IWebUIActivationStatics3(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), user.into_param().abi(), launcharguments.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::Core::AppRestartFailureReason>>(result__) }) } #[cfg(feature = "Foundation")] pub fn NewWebUIViewCreated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventHandler<NewWebUIViewCreatedEventArgs>>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics4(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveNewWebUIViewCreated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics4(|this| unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn BackgroundActivated<'a, Param0: ::windows::core::IntoParam<'a, BackgroundActivatedEventHandler>>(handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { Self::IWebUIActivationStatics4(|this| unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) }) } #[cfg(feature = "Foundation")] pub fn RemoveBackgroundActivated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(token: Param0) -> ::windows::core::Result<()> { Self::IWebUIActivationStatics4(|this| unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() }) } pub fn IWebUIActivationStatics<R, F: FnOnce(&IWebUIActivationStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIApplication, IWebUIActivationStatics> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn IWebUIActivationStatics2<R, F: FnOnce(&IWebUIActivationStatics2) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIApplication, IWebUIActivationStatics2> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn IWebUIActivationStatics3<R, F: FnOnce(&IWebUIActivationStatics3) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIApplication, IWebUIActivationStatics3> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn IWebUIActivationStatics4<R, F: FnOnce(&IWebUIActivationStatics4) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIApplication, IWebUIActivationStatics4> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } } impl ::windows::core::RuntimeName for WebUIApplication { const NAME: &'static str = "Windows.UI.WebUI.WebUIApplication"; } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIAppointmentsProviderAddAppointmentActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Appointments_AppointmentsProvider"))] pub fn AddAppointmentOperation(&self) -> ::windows::core::Result<super::super::ApplicationModel::Appointments::AppointmentsProvider::AddAppointmentOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Appointments::AppointmentsProvider::AddAppointmentOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIAppointmentsProviderAddAppointmentActivatedEventArgs;{a2861367-cee5-4e4d-9ed7-41c34ec18b02})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa2861367_cee5_4e4d_9ed7_41c34ec18b02); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIAppointmentsProviderAddAppointmentActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs { fn from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs { fn from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs> for &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderAddAppointmentActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderAddAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIAppointmentsProviderAddAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Appointments_AppointmentsProvider"))] pub fn RemoveAppointmentOperation(&self) -> ::windows::core::Result<super::super::ApplicationModel::Appointments::AppointmentsProvider::RemoveAppointmentOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Appointments::AppointmentsProvider::RemoveAppointmentOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs;{751f3ab8-0b8e-451c-9f15-966e699bac25})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x751f3ab8_0b8e_451c_9f15_966e699bac25); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs> for &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderRemoveAppointmentActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Appointments_AppointmentsProvider"))] pub fn ReplaceAppointmentOperation(&self) -> ::windows::core::Result<super::super::ApplicationModel::Appointments::AppointmentsProvider::ReplaceAppointmentOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Appointments::AppointmentsProvider::ReplaceAppointmentOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs;{1551b7d4-a981-4067-8a62-0524e4ade121})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1551b7d4_a981_4067_8a62_0524e4ade121); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs> for &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderReplaceAppointmentActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn InstanceStartDate(&self) -> ::windows::core::Result<super::super::Foundation::IReference<super::super::Foundation::DateTime>> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::IReference<super::super::Foundation::DateTime>>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn LocalId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn RoamingId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs;{3958f065-9841-4ca5-999b-885198b9ef2a})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3958f065_9841_4ca5_999b_885198b9ef2a); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIAppointmentsProviderShowAppointmentDetailsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn TimeToShow(&self) -> ::windows::core::Result<super::super::Foundation::DateTime> { let this = self; unsafe { let mut result__: super::super::Foundation::DateTime = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::DateTime>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn Duration(&self) -> ::windows::core::Result<super::super::Foundation::TimeSpan> { let this = self; unsafe { let mut result__: super::super::Foundation::TimeSpan = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::TimeSpan>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs;{9baeaba6-0e0b-49aa-babc-12b1dc774986})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9baeaba6_0e0b_49aa_babc_12b1dc774986); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs { fn from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs { fn from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs> for &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderShowTimeFrameActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> for &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IAppointmentsProviderActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } pub struct WebUIBackgroundTaskInstance {} impl WebUIBackgroundTaskInstance { pub fn Current() -> ::windows::core::Result<IWebUIBackgroundTaskInstance> { Self::IWebUIBackgroundTaskInstanceStatics(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<IWebUIBackgroundTaskInstance>(result__) }) } pub fn IWebUIBackgroundTaskInstanceStatics<R, F: FnOnce(&IWebUIBackgroundTaskInstanceStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIBackgroundTaskInstance, IWebUIBackgroundTaskInstanceStatics> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } } impl ::windows::core::RuntimeName for WebUIBackgroundTaskInstance { const NAME: &'static str = "Windows.UI.WebUI.WebUIBackgroundTaskInstance"; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIBackgroundTaskInstanceRuntimeClass(pub ::windows::core::IInspectable); impl WebUIBackgroundTaskInstanceRuntimeClass { pub fn Succeeded(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn SetSucceeded(&self, succeeded: bool) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), succeeded).ok() } } #[cfg(feature = "ApplicationModel_Background")] pub fn InstanceId(&self) -> ::windows::core::Result<::windows::core::GUID> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: ::windows::core::GUID = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::GUID>(result__) } } #[cfg(feature = "ApplicationModel_Background")] pub fn Task(&self) -> ::windows::core::Result<super::super::ApplicationModel::Background::BackgroundTaskRegistration> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Background::BackgroundTaskRegistration>(result__) } } #[cfg(feature = "ApplicationModel_Background")] pub fn Progress(&self) -> ::windows::core::Result<u32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: u32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u32>(result__) } } #[cfg(feature = "ApplicationModel_Background")] pub fn SetProgress(&self, value: u32) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } #[cfg(feature = "ApplicationModel_Background")] pub fn TriggerDetails(&self) -> ::windows::core::Result<::windows::core::IInspectable> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::IInspectable>(result__) } } #[cfg(all(feature = "ApplicationModel_Background", feature = "Foundation"))] pub fn Canceled<'a, Param0: ::windows::core::IntoParam<'a, super::super::ApplicationModel::Background::BackgroundTaskCanceledEventHandler>>(&self, cancelhandler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), cancelhandler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "ApplicationModel_Background", feature = "Foundation"))] pub fn RemoveCanceled<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, cookie: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), cookie.into_param().abi()).ok() } } #[cfg(feature = "ApplicationModel_Background")] pub fn SuspendedCount(&self) -> ::windows::core::Result<u32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: u32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u32>(result__) } } #[cfg(feature = "ApplicationModel_Background")] pub fn GetDeferral(&self) -> ::windows::core::Result<super::super::ApplicationModel::Background::BackgroundTaskDeferral> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Background::BackgroundTaskDeferral>(result__) } } } unsafe impl ::windows::core::RuntimeType for WebUIBackgroundTaskInstanceRuntimeClass { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIBackgroundTaskInstanceRuntimeClass;{23f12c25-e2f7-4741-bc9c-394595de24dc})"); } unsafe impl ::windows::core::Interface for WebUIBackgroundTaskInstanceRuntimeClass { type Vtable = IWebUIBackgroundTaskInstance_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x23f12c25_e2f7_4741_bc9c_394595de24dc); } impl ::windows::core::RuntimeName for WebUIBackgroundTaskInstanceRuntimeClass { const NAME: &'static str = "Windows.UI.WebUI.WebUIBackgroundTaskInstanceRuntimeClass"; } impl ::core::convert::From<WebUIBackgroundTaskInstanceRuntimeClass> for ::windows::core::IUnknown { fn from(value: WebUIBackgroundTaskInstanceRuntimeClass) -> Self { value.0 .0 } } impl ::core::convert::From<&WebUIBackgroundTaskInstanceRuntimeClass> for ::windows::core::IUnknown { fn from(value: &WebUIBackgroundTaskInstanceRuntimeClass) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<WebUIBackgroundTaskInstanceRuntimeClass> for ::windows::core::IInspectable { fn from(value: WebUIBackgroundTaskInstanceRuntimeClass) -> Self { value.0 } } impl ::core::convert::From<&WebUIBackgroundTaskInstanceRuntimeClass> for ::windows::core::IInspectable { fn from(value: &WebUIBackgroundTaskInstanceRuntimeClass) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<WebUIBackgroundTaskInstanceRuntimeClass> for IWebUIBackgroundTaskInstance { fn from(value: WebUIBackgroundTaskInstanceRuntimeClass) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&WebUIBackgroundTaskInstanceRuntimeClass> for IWebUIBackgroundTaskInstance { fn from(value: &WebUIBackgroundTaskInstanceRuntimeClass) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IWebUIBackgroundTaskInstance> for WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, IWebUIBackgroundTaskInstance> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IWebUIBackgroundTaskInstance> for &WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, IWebUIBackgroundTaskInstance> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Background")] impl ::core::convert::TryFrom<WebUIBackgroundTaskInstanceRuntimeClass> for super::super::ApplicationModel::Background::IBackgroundTaskInstance { type Error = ::windows::core::Error; fn try_from(value: WebUIBackgroundTaskInstanceRuntimeClass) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Background")] impl ::core::convert::TryFrom<&WebUIBackgroundTaskInstanceRuntimeClass> for super::super::ApplicationModel::Background::IBackgroundTaskInstance { type Error = ::windows::core::Error; fn try_from(value: &WebUIBackgroundTaskInstanceRuntimeClass) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Background")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Background::IBackgroundTaskInstance> for WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Background::IBackgroundTaskInstance> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Background")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Background::IBackgroundTaskInstance> for &WebUIBackgroundTaskInstanceRuntimeClass { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Background::IBackgroundTaskInstance> { ::core::convert::TryInto::<super::super::ApplicationModel::Background::IBackgroundTaskInstance>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIBarcodeScannerPreviewActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIBarcodeScannerPreviewActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ConnectionId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIBarcodeScannerPreviewActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIBarcodeScannerPreviewActivatedEventArgs;{6772797c-99bf-4349-af22-e4123560371c})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIBarcodeScannerPreviewActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6772797c_99bf_4349_af22_e4123560371c); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIBarcodeScannerPreviewActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIBarcodeScannerPreviewActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIBarcodeScannerPreviewActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIBarcodeScannerPreviewActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIBarcodeScannerPreviewActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIBarcodeScannerPreviewActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIBarcodeScannerPreviewActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIBarcodeScannerPreviewActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs { fn from(value: WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIBarcodeScannerPreviewActivatedEventArgs> for super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs { fn from(value: &WebUIBarcodeScannerPreviewActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs> for WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs> for &WebUIBarcodeScannerPreviewActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IBarcodeScannerPreviewActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for WebUIBarcodeScannerPreviewActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for WebUIBarcodeScannerPreviewActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUICachedFileUpdaterActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUICachedFileUpdaterActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage_Provider"))] pub fn CachedFileUpdaterUI(&self) -> ::windows::core::Result<super::super::Storage::Provider::CachedFileUpdaterUI> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::Provider::CachedFileUpdaterUI>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUICachedFileUpdaterActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUICachedFileUpdaterActivatedEventArgs;{d06eb1c7-3805-4ecb-b757-6cf15e26fef3})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUICachedFileUpdaterActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd06eb1c7_3805_4ecb_b757_6cf15e26fef3); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUICachedFileUpdaterActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUICachedFileUpdaterActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICachedFileUpdaterActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUICachedFileUpdaterActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICachedFileUpdaterActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICachedFileUpdaterActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUICachedFileUpdaterActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICachedFileUpdaterActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs { fn from(value: WebUICachedFileUpdaterActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs { fn from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs> for &WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICachedFileUpdaterActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICachedFileUpdaterActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICachedFileUpdaterActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICachedFileUpdaterActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUICachedFileUpdaterActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUICachedFileUpdaterActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUICameraSettingsActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUICameraSettingsActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn VideoDeviceController(&self) -> ::windows::core::Result<::windows::core::IInspectable> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::IInspectable>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn VideoDeviceExtension(&self) -> ::windows::core::Result<::windows::core::IInspectable> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::IInspectable>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUICameraSettingsActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUICameraSettingsActivatedEventArgs;{fb67a508-2dad-490a-9170-dca036eb114b})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUICameraSettingsActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfb67a508_2dad_490a_9170_dca036eb114b); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUICameraSettingsActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUICameraSettingsActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICameraSettingsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUICameraSettingsActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICameraSettingsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUICameraSettingsActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICameraSettingsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUICameraSettingsActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICameraSettingsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUICameraSettingsActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICameraSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs { fn from(value: WebUICameraSettingsActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICameraSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs { fn from(value: &WebUICameraSettingsActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs> for WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs> for &WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICameraSettingsActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICameraSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUICameraSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICameraSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUICameraSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICameraSettingsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUICameraSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICameraSettingsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUICameraSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUICameraSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUICommandLineActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUICommandLineActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Operation(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::CommandLineActivationOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::CommandLineActivationOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUICommandLineActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUICommandLineActivatedEventArgs;{4506472c-006a-48eb-8afb-d07ab25e3366})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUICommandLineActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4506472c_006a_48eb_8afb_d07ab25e3366); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUICommandLineActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUICommandLineActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICommandLineActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUICommandLineActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICommandLineActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUICommandLineActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICommandLineActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUICommandLineActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICommandLineActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUICommandLineActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICommandLineActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICommandLineActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUICommandLineActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs { fn from(value: WebUICommandLineActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUICommandLineActivatedEventArgs> for super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs { fn from(value: &WebUICommandLineActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs> for WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs> for &WebUICommandLineActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ICommandLineActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for WebUICommandLineActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for WebUICommandLineActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactCallActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactCallActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceUserId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactCallActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactCallActivatedEventArgs;{c2df14c7-30eb-41c6-b3bc-5b1694f9dab3})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactCallActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc2df14c7_30eb_41c6_b3bc_5b1694f9dab3); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactCallActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactCallActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactCallActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactCallActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactCallActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactCallActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs { fn from(value: WebUIContactCallActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs { fn from(value: &WebUIContactCallActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs> for &WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactCallActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for &WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactMapActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactMapActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Address(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::ContactAddress> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::ContactAddress>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactMapActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactMapActivatedEventArgs;{b32bf870-eee7-4ad2-aaf1-a87effcf00a4})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactMapActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb32bf870_eee7_4ad2_aaf1_a87effcf00a4); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactMapActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactMapActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMapActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactMapActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMapActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactMapActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMapActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactMapActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMapActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactMapActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs { fn from(value: WebUIContactMapActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs { fn from(value: &WebUIContactMapActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs> for &WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactMapActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMapActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for &WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMapActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMapActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMapActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactMapActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactMessageActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactMessageActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceUserId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactMessageActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactMessageActivatedEventArgs;{de598db2-0e03-43b0-bf56-bcc40b3162df})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactMessageActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xde598db2_0e03_43b0_bf56_bcc40b3162df); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactMessageActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactMessageActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMessageActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactMessageActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMessageActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactMessageActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMessageActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactMessageActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMessageActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactMessageActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs { fn from(value: WebUIContactMessageActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs { fn from(value: &WebUIContactMessageActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs> for &WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactMessageActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMessageActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for &WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactMessageActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactMessageActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactMessageActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactMessageActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactPanelActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactPanelActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn ContactPanel(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::ContactPanel> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::ContactPanel>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactPanelActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactPanelActivatedEventArgs;{52bb63e4-d3d4-4b63-8051-4af2082cab80})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactPanelActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x52bb63e4_d3d4_4b63_8051_4af2082cab80); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactPanelActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactPanelActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPanelActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactPanelActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPanelActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactPanelActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPanelActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactPanelActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPanelActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactPanelActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPanelActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPanelActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPanelActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs { fn from(value: WebUIContactPanelActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPanelActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs { fn from(value: &WebUIContactPanelActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs> for WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs> for &WebUIContactPanelActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPanelActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for WebUIContactPanelActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for WebUIContactPanelActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactPickerActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactPickerActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts_Provider"))] pub fn ContactPickerUI(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Provider::ContactPickerUI> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Provider::ContactPickerUI>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactPickerActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactPickerActivatedEventArgs;{ce57aae7-6449-45a7-971f-d113be7a8936})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactPickerActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xce57aae7_6449_45a7_971f_d113be7a8936); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactPickerActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactPickerActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactPickerActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactPickerActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactPickerActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactPickerActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs { fn from(value: WebUIContactPickerActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs { fn from(value: &WebUIContactPickerActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs> for WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs> for &WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPickerActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactPostActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactPostActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceUserId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactPostActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactPostActivatedEventArgs;{b35a3c67-f1e7-4655-ad6e-4857588f552f})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactPostActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb35a3c67_f1e7_4655_ad6e_4857588f552f); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactPostActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactPostActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPostActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactPostActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPostActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactPostActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPostActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactPostActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPostActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactPostActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs { fn from(value: WebUIContactPostActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs { fn from(value: &WebUIContactPostActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs> for &WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactPostActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPostActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for &WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactPostActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactPostActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactPostActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactPostActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIContactVideoCallActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIContactVideoCallActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ServiceUserId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Contacts"))] pub fn Contact(&self) -> ::windows::core::Result<super::super::ApplicationModel::Contacts::Contact> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Contacts::Contact>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIContactVideoCallActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIContactVideoCallActivatedEventArgs;{61079db8-e3e7-4b4f-858d-5c63a96ef684})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIContactVideoCallActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x61079db8_e3e7_4b4f_858d_5c63a96ef684); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIContactVideoCallActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIContactVideoCallActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactVideoCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIContactVideoCallActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactVideoCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIContactVideoCallActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactVideoCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIContactVideoCallActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactVideoCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIContactVideoCallActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs { fn from(value: WebUIContactVideoCallActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs { fn from(value: &WebUIContactVideoCallActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs> for &WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactVideoCallActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactVideoCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IContactActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> for &WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContactActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContactActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIContactVideoCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIContactVideoCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIContactVideoCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIContactVideoCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIDeviceActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIDeviceActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn DeviceInformationId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIDeviceActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIDeviceActivatedEventArgs;{cd50b9a9-ce10-44d2-8234-c355a073ef33})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIDeviceActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcd50b9a9_ce10_44d2_8234_c355a073ef33); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIDeviceActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIDeviceActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDeviceActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIDeviceActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDeviceActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIDeviceActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDeviceActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIDeviceActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDeviceActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIDeviceActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs { fn from(value: WebUIDeviceActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs { fn from(value: &WebUIDeviceActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs> for &WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDeviceActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDeviceActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDeviceActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDeviceActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIDeviceActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIDeviceActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIDevicePairingActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIDevicePairingActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Devices_Enumeration"))] pub fn DeviceInformation(&self) -> ::windows::core::Result<super::super::Devices::Enumeration::DeviceInformation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Devices::Enumeration::DeviceInformation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIDevicePairingActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIDevicePairingActivatedEventArgs;{eba0d1e4-ecc6-4148-94ed-f4b37ec05b3e})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIDevicePairingActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xeba0d1e4_ecc6_4148_94ed_f4b37ec05b3e); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIDevicePairingActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIDevicePairingActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDevicePairingActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIDevicePairingActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDevicePairingActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIDevicePairingActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDevicePairingActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIDevicePairingActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDevicePairingActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIDevicePairingActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDevicePairingActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDevicePairingActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs { fn from(value: WebUIDevicePairingActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs { fn from(value: &WebUIDevicePairingActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs> for &WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDevicePairingActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDevicePairingActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIDevicePairingActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIDevicePairingActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIDialReceiverActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIDialReceiverActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn AppName(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Arguments(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn TileId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIDialReceiverActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIDialReceiverActivatedEventArgs;{fb777ed7-85ee-456e-a44d-85d730e70aed})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIDialReceiverActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfb777ed7_85ee_456e_a44d_85d730e70aed); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIDialReceiverActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIDialReceiverActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDialReceiverActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIDialReceiverActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDialReceiverActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIDialReceiverActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDialReceiverActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIDialReceiverActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDialReceiverActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIDialReceiverActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs { fn from(value: WebUIDialReceiverActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs { fn from(value: &WebUIDialReceiverActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IDialReceiverActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDialReceiverActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDialReceiverActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIDialReceiverActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIDialReceiverActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIDialReceiverActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFileActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFileActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections", feature = "Storage"))] pub fn Files(&self) -> ::windows::core::Result<super::super::Foundation::Collections::IVectorView<super::super::Storage::IStorageItem>> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::IVectorView<super::super::Storage::IStorageItem>>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Verb(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage_Search"))] pub fn NeighboringFilesQuery(&self) -> ::windows::core::Result<super::super::Storage::Search::StorageFileQueryResult> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::Search::StorageFileQueryResult>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFileActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFileActivatedEventArgs;{bb2afc33-93b1-42ed-8b26-236dd9c78496})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFileActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFileActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xbb2afc33_93b1_42ed_8b26_236dd9c78496); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFileActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFileActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFileActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFileActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFileActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFileActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileActivatedEventArgs { fn from(value: WebUIFileActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileActivatedEventArgs { fn from(value: &WebUIFileActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgs> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgs> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles { type Error = ::windows::core::Error; fn try_from(value: WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IFileActivatedEventArgsWithNeighboringFiles>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFileActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFileOpenPickerActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFileOpenPickerActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage_Pickers_Provider"))] pub fn FileOpenPickerUI(&self) -> ::windows::core::Result<super::super::Storage::Pickers::Provider::FileOpenPickerUI> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::Pickers::Provider::FileOpenPickerUI>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CallerPackageFamilyName(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFileOpenPickerActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFileOpenPickerActivatedEventArgs;{72827082-5525-4bf2-bc09-1f5095d4964d})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFileOpenPickerActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x72827082_5525_4bf2_bc09_1f5095d4964d); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFileOpenPickerActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFileOpenPickerActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFileOpenPickerActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFileOpenPickerActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFileOpenPickerActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFileOpenPickerActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs { fn from(value: WebUIFileOpenPickerActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs { fn from(value: &WebUIFileOpenPickerActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs> for &WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2> for &WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IFileOpenPickerActivatedEventArgs2>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFileOpenPickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFileOpenPickerContinuationEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFileOpenPickerContinuationEventArgs { #[cfg(feature = "deprecated")] #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections", feature = "Storage"))] pub fn Files(&self) -> ::windows::core::Result<super::super::Foundation::Collections::IVectorView<super::super::Storage::StorageFile>> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::IVectorView<super::super::Storage::StorageFile>>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn ContinuationData(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFileOpenPickerContinuationEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFileOpenPickerContinuationEventArgs;{f0fa3f3a-d4e8-4ad3-9c34-2308f32fcec9})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFileOpenPickerContinuationEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf0fa3f3a_d4e8_4ad3_9c34_2308f32fcec9); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFileOpenPickerContinuationEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFileOpenPickerContinuationEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFileOpenPickerContinuationEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFileOpenPickerContinuationEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFileOpenPickerContinuationEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFileOpenPickerContinuationEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs { fn from(value: WebUIFileOpenPickerContinuationEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs { fn from(value: &WebUIFileOpenPickerContinuationEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs> for &WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileOpenPickerContinuationEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for &WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileOpenPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileOpenPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFileOpenPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFileSavePickerActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFileSavePickerActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage_Pickers_Provider"))] pub fn FileSavePickerUI(&self) -> ::windows::core::Result<super::super::Storage::Pickers::Provider::FileSavePickerUI> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::Pickers::Provider::FileSavePickerUI>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CallerPackageFamilyName(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn EnterpriseId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFileSavePickerActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFileSavePickerActivatedEventArgs;{81c19cf1-74e6-4387-82eb-bb8fd64b4346})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFileSavePickerActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x81c19cf1_74e6_4387_82eb_bb8fd64b4346); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFileSavePickerActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFileSavePickerActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFileSavePickerActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFileSavePickerActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFileSavePickerActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFileSavePickerActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs { fn from(value: WebUIFileSavePickerActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs { fn from(value: &WebUIFileSavePickerActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs> for &WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2> for &WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IFileSavePickerActivatedEventArgs2>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFileSavePickerActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFileSavePickerContinuationEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFileSavePickerContinuationEventArgs { #[cfg(feature = "deprecated")] #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage"))] pub fn File(&self) -> ::windows::core::Result<super::super::Storage::StorageFile> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::StorageFile>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn ContinuationData(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFileSavePickerContinuationEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFileSavePickerContinuationEventArgs;{2c846fe1-3bad-4f33-8c8b-e46fae824b4b})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFileSavePickerContinuationEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2c846fe1_3bad_4f33_8c8b_e46fae824b4b); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFileSavePickerContinuationEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFileSavePickerContinuationEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFileSavePickerContinuationEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFileSavePickerContinuationEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFileSavePickerContinuationEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFileSavePickerContinuationEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs { fn from(value: WebUIFileSavePickerContinuationEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs { fn from(value: &WebUIFileSavePickerContinuationEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs> for &WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFileSavePickerContinuationEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for &WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFileSavePickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFileSavePickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFileSavePickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIFolderPickerContinuationEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIFolderPickerContinuationEventArgs { #[cfg(feature = "deprecated")] #[cfg(all(feature = "ApplicationModel_Activation", feature = "Storage"))] pub fn Folder(&self) -> ::windows::core::Result<super::super::Storage::StorageFolder> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Storage::StorageFolder>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn ContinuationData(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIFolderPickerContinuationEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIFolderPickerContinuationEventArgs;{51882366-9f4b-498f-beb0-42684f6e1c29})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIFolderPickerContinuationEventArgs { type Vtable = super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x51882366_9f4b_498f_beb0_42684f6e1c29); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIFolderPickerContinuationEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIFolderPickerContinuationEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFolderPickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIFolderPickerContinuationEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFolderPickerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIFolderPickerContinuationEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFolderPickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIFolderPickerContinuationEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFolderPickerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIFolderPickerContinuationEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs { fn from(value: WebUIFolderPickerContinuationEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs { fn from(value: &WebUIFolderPickerContinuationEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs> for &WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IFolderPickerContinuationEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for &WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFolderPickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFolderPickerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIFolderPickerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIFolderPickerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIFolderPickerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUILaunchActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUILaunchActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Arguments(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn TileId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PrelaunchActivated(&self) -> ::windows::core::Result<bool> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs>(self)?; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn TileActivatedInfo(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::TileActivatedInfo> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::TileActivatedInfo>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUILaunchActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUILaunchActivatedEventArgs;{fbc93e26-a14a-4b4f-82b0-33bed920af52})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUILaunchActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfbc93e26_a14a_4b4f_82b0_33bed920af52); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUILaunchActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUILaunchActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILaunchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUILaunchActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILaunchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUILaunchActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILaunchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUILaunchActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILaunchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUILaunchActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { fn from(value: WebUILaunchActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { fn from(value: &WebUILaunchActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IPrelaunchActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2 { type Error = ::windows::core::Error; fn try_from(value: &WebUILaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2> for WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2> for &WebUILaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs2>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUILockScreenActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUILockScreenActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Info(&self) -> ::windows::core::Result<::windows::core::IInspectable> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::IInspectable>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUILockScreenActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUILockScreenActivatedEventArgs;{3ca77966-6108-4a41-8220-ee7d133c8532})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUILockScreenActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3ca77966_6108_4a41_8220_ee7d133c8532); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUILockScreenActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUILockScreenActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUILockScreenActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUILockScreenActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUILockScreenActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUILockScreenActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs { fn from(value: WebUILockScreenActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs { fn from(value: &WebUILockScreenActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs> for &WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILockScreenActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUILockScreenActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUILockScreenCallActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUILockScreenCallActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Calls"))] pub fn CallUI(&self) -> ::windows::core::Result<super::super::ApplicationModel::Calls::LockScreenCallUI> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Calls::LockScreenCallUI>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Arguments(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn TileId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUILockScreenCallActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUILockScreenCallActivatedEventArgs;{06f37fbe-b5f2-448b-b13e-e328ac1c516a})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUILockScreenCallActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x06f37fbe_b5f2_448b_b13e_e328ac1c516a); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUILockScreenCallActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUILockScreenCallActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUILockScreenCallActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUILockScreenCallActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUILockScreenCallActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUILockScreenCallActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs { fn from(value: WebUILockScreenCallActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs { fn from(value: &WebUILockScreenCallActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs> for &WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILockScreenCallActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenCallActivatedEventArgs> for super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> for &WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::ILaunchActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUILockScreenCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUILockScreenComponentActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUILockScreenComponentActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = self; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = self; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUILockScreenComponentActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUILockScreenComponentActivatedEventArgs;{cf651713-cd08-4fd8-b697-a281b6544e2e})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUILockScreenComponentActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcf651713_cd08_4fd8_b697_a281b6544e2e); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUILockScreenComponentActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUILockScreenComponentActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenComponentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUILockScreenComponentActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenComponentActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUILockScreenComponentActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenComponentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUILockScreenComponentActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenComponentActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUILockScreenComponentActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUILockScreenComponentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { fn from(value: WebUILockScreenComponentActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUILockScreenComponentActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { fn from(value: &WebUILockScreenComponentActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUILockScreenComponentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUILockScreenComponentActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUILockScreenComponentActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUILockScreenComponentActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUILockScreenComponentActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUINavigatedDeferral(pub ::windows::core::IInspectable); impl WebUINavigatedDeferral { pub fn Complete(&self) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this)).ok() } } } unsafe impl ::windows::core::RuntimeType for WebUINavigatedDeferral { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUINavigatedDeferral;{d804204d-831f-46e2-b432-3afce211f962})"); } unsafe impl ::windows::core::Interface for WebUINavigatedDeferral { type Vtable = IWebUINavigatedDeferral_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd804204d_831f_46e2_b432_3afce211f962); } impl ::windows::core::RuntimeName for WebUINavigatedDeferral { const NAME: &'static str = "Windows.UI.WebUI.WebUINavigatedDeferral"; } impl ::core::convert::From<WebUINavigatedDeferral> for ::windows::core::IUnknown { fn from(value: WebUINavigatedDeferral) -> Self { value.0 .0 } } impl ::core::convert::From<&WebUINavigatedDeferral> for ::windows::core::IUnknown { fn from(value: &WebUINavigatedDeferral) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUINavigatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUINavigatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<WebUINavigatedDeferral> for ::windows::core::IInspectable { fn from(value: WebUINavigatedDeferral) -> Self { value.0 } } impl ::core::convert::From<&WebUINavigatedDeferral> for ::windows::core::IInspectable { fn from(value: &WebUINavigatedDeferral) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUINavigatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUINavigatedDeferral { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUINavigatedEventArgs(pub ::windows::core::IInspectable); impl WebUINavigatedEventArgs { pub fn NavigatedOperation(&self) -> ::windows::core::Result<WebUINavigatedOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<WebUINavigatedOperation>(result__) } } } unsafe impl ::windows::core::RuntimeType for WebUINavigatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUINavigatedEventArgs;{a75841b8-2499-4030-a69d-15d2d9cfe524})"); } unsafe impl ::windows::core::Interface for WebUINavigatedEventArgs { type Vtable = IWebUINavigatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa75841b8_2499_4030_a69d_15d2d9cfe524); } impl ::windows::core::RuntimeName for WebUINavigatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUINavigatedEventArgs"; } impl ::core::convert::From<WebUINavigatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUINavigatedEventArgs) -> Self { value.0 .0 } } impl ::core::convert::From<&WebUINavigatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUINavigatedEventArgs) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<WebUINavigatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUINavigatedEventArgs) -> Self { value.0 } } impl ::core::convert::From<&WebUINavigatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUINavigatedEventArgs) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<WebUINavigatedEventArgs> for IWebUINavigatedEventArgs { fn from(value: WebUINavigatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&WebUINavigatedEventArgs> for IWebUINavigatedEventArgs { fn from(value: &WebUINavigatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IWebUINavigatedEventArgs> for WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IWebUINavigatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IWebUINavigatedEventArgs> for &WebUINavigatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IWebUINavigatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUINavigatedOperation(pub ::windows::core::IInspectable); impl WebUINavigatedOperation { pub fn GetDeferral(&self) -> ::windows::core::Result<WebUINavigatedDeferral> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<WebUINavigatedDeferral>(result__) } } } unsafe impl ::windows::core::RuntimeType for WebUINavigatedOperation { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUINavigatedOperation;{7a965f08-8182-4a89-ab67-8492e8750d4b})"); } unsafe impl ::windows::core::Interface for WebUINavigatedOperation { type Vtable = IWebUINavigatedOperation_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7a965f08_8182_4a89_ab67_8492e8750d4b); } impl ::windows::core::RuntimeName for WebUINavigatedOperation { const NAME: &'static str = "Windows.UI.WebUI.WebUINavigatedOperation"; } impl ::core::convert::From<WebUINavigatedOperation> for ::windows::core::IUnknown { fn from(value: WebUINavigatedOperation) -> Self { value.0 .0 } } impl ::core::convert::From<&WebUINavigatedOperation> for ::windows::core::IUnknown { fn from(value: &WebUINavigatedOperation) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUINavigatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUINavigatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<WebUINavigatedOperation> for ::windows::core::IInspectable { fn from(value: WebUINavigatedOperation) -> Self { value.0 } } impl ::core::convert::From<&WebUINavigatedOperation> for ::windows::core::IInspectable { fn from(value: &WebUINavigatedOperation) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUINavigatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUINavigatedOperation { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIPhoneCallActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIPhoneCallActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn LineId(&self) -> ::windows::core::Result<::windows::core::GUID> { let this = self; unsafe { let mut result__: ::windows::core::GUID = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::GUID>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIPhoneCallActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIPhoneCallActivatedEventArgs;{54615221-a3c1-4ced-b62f-8c60523619ad})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIPhoneCallActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x54615221_a3c1_4ced_b62f_8c60523619ad); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIPhoneCallActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIPhoneCallActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPhoneCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIPhoneCallActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPhoneCallActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIPhoneCallActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPhoneCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIPhoneCallActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPhoneCallActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIPhoneCallActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPhoneCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPhoneCallActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIPhoneCallActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs { fn from(value: WebUIPhoneCallActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPhoneCallActivatedEventArgs> for super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs { fn from(value: &WebUIPhoneCallActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs> for WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs> for &WebUIPhoneCallActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPhoneCallActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for WebUIPhoneCallActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for WebUIPhoneCallActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIPrint3DWorkflowActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIPrint3DWorkflowActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Devices_Printers_Extensions"))] pub fn Workflow(&self) -> ::windows::core::Result<super::super::Devices::Printers::Extensions::Print3DWorkflow> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Devices::Printers::Extensions::Print3DWorkflow>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIPrint3DWorkflowActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIPrint3DWorkflowActivatedEventArgs;{3f57e78b-f2ac-4619-8302-ef855e1c9b90})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIPrint3DWorkflowActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3f57e78b_f2ac_4619_8302_ef855e1c9b90); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIPrint3DWorkflowActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIPrint3DWorkflowActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrint3DWorkflowActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIPrint3DWorkflowActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrint3DWorkflowActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIPrint3DWorkflowActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrint3DWorkflowActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIPrint3DWorkflowActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrint3DWorkflowActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIPrint3DWorkflowActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrint3DWorkflowActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs { fn from(value: WebUIPrint3DWorkflowActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrint3DWorkflowActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs { fn from(value: &WebUIPrint3DWorkflowActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs> for WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs> for &WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrint3DWorkflowActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPrint3DWorkflowActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIPrint3DWorkflowActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPrint3DWorkflowActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIPrint3DWorkflowActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPrint3DWorkflowActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIPrint3DWorkflowActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPrint3DWorkflowActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIPrint3DWorkflowActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIPrint3DWorkflowActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIPrintTaskSettingsActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIPrintTaskSettingsActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Devices_Printers_Extensions"))] pub fn Configuration(&self) -> ::windows::core::Result<super::super::Devices::Printers::Extensions::PrintTaskConfiguration> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Devices::Printers::Extensions::PrintTaskConfiguration>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIPrintTaskSettingsActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIPrintTaskSettingsActivatedEventArgs;{ee30a0c9-ce56-4865-ba8e-8954ac271107})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIPrintTaskSettingsActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xee30a0c9_ce56_4865_ba8e_8954ac271107); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIPrintTaskSettingsActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIPrintTaskSettingsActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintTaskSettingsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIPrintTaskSettingsActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintTaskSettingsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIPrintTaskSettingsActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintTaskSettingsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIPrintTaskSettingsActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintTaskSettingsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIPrintTaskSettingsActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintTaskSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs { fn from(value: WebUIPrintTaskSettingsActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintTaskSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs { fn from(value: &WebUIPrintTaskSettingsActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs> for WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs> for &WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IPrintTaskSettingsActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPrintTaskSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIPrintTaskSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPrintTaskSettingsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIPrintTaskSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPrintTaskSettingsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIPrintTaskSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPrintTaskSettingsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIPrintTaskSettingsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIPrintTaskSettingsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIPrintWorkflowForegroundTaskActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIPrintWorkflowForegroundTaskActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = self; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = self; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIPrintWorkflowForegroundTaskActivatedEventArgs;{cf651713-cd08-4fd8-b697-a281b6544e2e})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcf651713_cd08_4fd8_b697_a281b6544e2e); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIPrintWorkflowForegroundTaskActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { fn from(value: WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { fn from(value: &WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIPrintWorkflowForegroundTaskActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIPrintWorkflowForegroundTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIPrintWorkflowForegroundTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIProtocolActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIProtocolActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn Uri(&self) -> ::windows::core::Result<super::super::Foundation::Uri> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Uri>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CallerPackageFamilyName(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn Data(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIProtocolActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIProtocolActivatedEventArgs;{6095f4dd-b7c0-46ab-81fe-d90f36d00d24})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIProtocolActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6095f4dd_b7c0_46ab_81fe_d90f36d00d24); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIProtocolActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIProtocolActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIProtocolActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIProtocolActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIProtocolActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIProtocolActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs { fn from(value: WebUIProtocolActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs { fn from(value: &WebUIProtocolActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIProtocolActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIProtocolForResultsActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIProtocolForResultsActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn ProtocolForResultsOperation(&self) -> ::windows::core::Result<super::super::System::ProtocolForResultsOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::ProtocolForResultsOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn Uri(&self) -> ::windows::core::Result<super::super::Foundation::Uri> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Uri>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CallerPackageFamilyName(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn Data(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIProtocolForResultsActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIProtocolForResultsActivatedEventArgs;{e75132c2-7ae7-4517-80ac-dbe8d7cc5b9c})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIProtocolForResultsActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe75132c2_7ae7_4517_80ac_dbe8d7cc5b9c); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIProtocolForResultsActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIProtocolForResultsActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolForResultsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIProtocolForResultsActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolForResultsActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIProtocolForResultsActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolForResultsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIProtocolForResultsActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolForResultsActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIProtocolForResultsActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs { fn from(value: WebUIProtocolForResultsActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs { fn from(value: &WebUIProtocolForResultsActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolForResultsActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIProtocolForResultsActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIProtocolForResultsActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIProtocolForResultsActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIRestrictedLaunchActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIRestrictedLaunchActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn SharedContext(&self) -> ::windows::core::Result<::windows::core::IInspectable> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::IInspectable>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIRestrictedLaunchActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIRestrictedLaunchActivatedEventArgs;{e0b7ac81-bfc3-4344-a5da-19fd5a27baae})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIRestrictedLaunchActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe0b7ac81_bfc3_4344_a5da_19fd5a27baae); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIRestrictedLaunchActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIRestrictedLaunchActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIRestrictedLaunchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIRestrictedLaunchActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIRestrictedLaunchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIRestrictedLaunchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIRestrictedLaunchActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIRestrictedLaunchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs { fn from(value: WebUIRestrictedLaunchActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs { fn from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs> for &WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IRestrictedLaunchActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIRestrictedLaunchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIRestrictedLaunchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIRestrictedLaunchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIRestrictedLaunchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIRestrictedLaunchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUISearchActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUISearchActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn QueryText(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Language(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn CurrentlyShownApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>(self)?; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Search"))] pub fn LinguisticDetails(&self) -> ::windows::core::Result<super::super::ApplicationModel::Search::SearchPaneQueryLinguisticDetails> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Search::SearchPaneQueryLinguisticDetails>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUISearchActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUISearchActivatedEventArgs;{8cb36951-58c8-43e3-94bc-41d33f8b630e})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUISearchActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::ISearchActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8cb36951_58c8_43e3_94bc_41d33f8b630e); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUISearchActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUISearchActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUISearchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUISearchActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUISearchActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUISearchActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUISearchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUISearchActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUISearchActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUISearchActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::ISearchActivatedEventArgs { fn from(value: WebUISearchActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::ISearchActivatedEventArgs { fn from(value: &WebUISearchActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgs> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgs> for &WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> for &WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IApplicationViewActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails { type Error = ::windows::core::Error; fn try_from(value: WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUISearchActivatedEventArgs> for super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails { type Error = ::windows::core::Error; fn try_from(value: &WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails> for &WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::ISearchActivatedEventArgsWithLinguisticDetails>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUISearchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUISearchActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUISearchActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUISearchActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIShareTargetActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIShareTargetActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_DataTransfer_ShareTarget"))] pub fn ShareOperation(&self) -> ::windows::core::Result<super::super::ApplicationModel::DataTransfer::ShareTarget::ShareOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::DataTransfer::ShareTarget::ShareOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIShareTargetActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIShareTargetActivatedEventArgs;{4bdaf9c8-cdb2-4acb-bfc3-6648563378ec})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIShareTargetActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4bdaf9c8_cdb2_4acb_bfc3_6648563378ec); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIShareTargetActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIShareTargetActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIShareTargetActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIShareTargetActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIShareTargetActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIShareTargetActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIShareTargetActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIShareTargetActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIShareTargetActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIShareTargetActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs { fn from(value: WebUIShareTargetActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs { fn from(value: &WebUIShareTargetActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs> for &WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IShareTargetActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIShareTargetActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIShareTargetActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIShareTargetActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIShareTargetActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIShareTargetActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIStartupTaskActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIStartupTaskActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn TaskId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIStartupTaskActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIStartupTaskActivatedEventArgs;{03b11a58-5276-4d91-8621-54611864d5fa})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIStartupTaskActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x03b11a58_5276_4d91_8621_54611864d5fa); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIStartupTaskActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIStartupTaskActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIStartupTaskActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIStartupTaskActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIStartupTaskActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIStartupTaskActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIStartupTaskActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIStartupTaskActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIStartupTaskActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIStartupTaskActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIStartupTaskActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIStartupTaskActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIStartupTaskActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs { fn from(value: WebUIStartupTaskActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIStartupTaskActivatedEventArgs> for super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs { fn from(value: &WebUIStartupTaskActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs> for WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs> for &WebUIStartupTaskActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IStartupTaskActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Send for WebUIStartupTaskActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::core::marker::Sync for WebUIStartupTaskActivatedEventArgs {} #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIToastNotificationActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIToastNotificationActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Argument(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn UserInput(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIToastNotificationActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIToastNotificationActivatedEventArgs;{92a86f82-5290-431d-be85-c4aaeeb8685f})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIToastNotificationActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x92a86f82_5290_431d_be85_c4aaeeb8685f); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIToastNotificationActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIToastNotificationActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIToastNotificationActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIToastNotificationActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIToastNotificationActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIToastNotificationActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIToastNotificationActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIToastNotificationActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIToastNotificationActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIToastNotificationActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs { fn from(value: WebUIToastNotificationActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs { fn from(value: &WebUIToastNotificationActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs> for &WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IToastNotificationActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIToastNotificationActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIToastNotificationActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIToastNotificationActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIToastNotificationActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIToastNotificationActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIUserDataAccountProviderActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIUserDataAccountProviderActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_UserDataAccounts_Provider"))] pub fn Operation(&self) -> ::windows::core::Result<super::super::ApplicationModel::UserDataAccounts::Provider::IUserDataAccountProviderOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::UserDataAccounts::Provider::IUserDataAccountProviderOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIUserDataAccountProviderActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIUserDataAccountProviderActivatedEventArgs;{1bc9f723-8ef1-4a51-a63a-fe711eeab607})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIUserDataAccountProviderActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1bc9f723_8ef1_4a51_a63a_fe711eeab607); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIUserDataAccountProviderActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIUserDataAccountProviderActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIUserDataAccountProviderActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIUserDataAccountProviderActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIUserDataAccountProviderActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIUserDataAccountProviderActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIUserDataAccountProviderActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIUserDataAccountProviderActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIUserDataAccountProviderActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIUserDataAccountProviderActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIUserDataAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIUserDataAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIUserDataAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIUserDataAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIUserDataAccountProviderActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIUserDataAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIUserDataAccountProviderActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIUserDataAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIUserDataAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs { fn from(value: WebUIUserDataAccountProviderActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIUserDataAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs { fn from(value: &WebUIUserDataAccountProviderActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs> for WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs> for &WebUIUserDataAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IUserDataAccountProviderActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIView(pub ::windows::core::IInspectable); impl WebUIView { #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn Source(&self) -> ::windows::core::Result<super::super::Foundation::Uri> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Uri>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn SetSource<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::Uri>>(&self, source: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), source.into_param().abi()).ok() } } #[cfg(feature = "Web_UI")] pub fn DocumentTitle(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "Web_UI")] pub fn CanGoBack(&self) -> ::windows::core::Result<bool> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } #[cfg(feature = "Web_UI")] pub fn CanGoForward(&self) -> ::windows::core::Result<bool> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } #[cfg(feature = "Web_UI")] pub fn SetDefaultBackgroundColor<'a, Param0: ::windows::core::IntoParam<'a, super::Color>>(&self, value: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value.into_param().abi()).ok() } } #[cfg(feature = "Web_UI")] pub fn DefaultBackgroundColor(&self) -> ::windows::core::Result<super::Color> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::Color = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::Color>(result__) } } #[cfg(feature = "Web_UI")] pub fn ContainsFullScreenElement(&self) -> ::windows::core::Result<bool> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } #[cfg(feature = "Web_UI")] pub fn Settings(&self) -> ::windows::core::Result<super::super::Web::UI::WebViewControlSettings> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Web::UI::WebViewControlSettings>(result__) } } #[cfg(all(feature = "Foundation_Collections", feature = "Web_UI"))] pub fn DeferredPermissionRequests(&self) -> ::windows::core::Result<super::super::Foundation::Collections::IVectorView<super::super::Web::UI::WebViewControlDeferredPermissionRequest>> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::IVectorView<super::super::Web::UI::WebViewControlDeferredPermissionRequest>>(result__) } } #[cfg(feature = "Web_UI")] pub fn GoForward(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).16)(::core::mem::transmute_copy(this)).ok() } } #[cfg(feature = "Web_UI")] pub fn GoBack(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).17)(::core::mem::transmute_copy(this)).ok() } } #[cfg(feature = "Web_UI")] pub fn Refresh(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).18)(::core::mem::transmute_copy(this)).ok() } } #[cfg(feature = "Web_UI")] pub fn Stop(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).19)(::core::mem::transmute_copy(this)).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn Navigate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::Uri>>(&self, source: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).20)(::core::mem::transmute_copy(this), source.into_param().abi()).ok() } } #[cfg(feature = "Web_UI")] pub fn NavigateToString<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(&self, text: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).21)(::core::mem::transmute_copy(this), text.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web", feature = "Web_UI"))] pub fn NavigateToLocalStreamUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::Uri>, Param1: ::windows::core::IntoParam<'a, super::super::Web::IUriToStreamResolver>>(&self, source: Param0, streamresolver: Param1) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).22)(::core::mem::transmute_copy(this), source.into_param().abi(), streamresolver.into_param().abi()).ok() } } #[cfg(all(feature = "Web_Http", feature = "Web_UI"))] pub fn NavigateWithHttpRequestMessage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Web::Http::HttpRequestMessage>>(&self, requestmessage: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).23)(::core::mem::transmute_copy(this), requestmessage.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Foundation_Collections", feature = "Web_UI"))] pub fn InvokeScriptAsync<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::Collections::IIterable<::windows::core::HSTRING>>>(&self, scriptname: Param0, arguments: Param1) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<::windows::core::HSTRING>> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).24)(::core::mem::transmute_copy(this), scriptname.into_param().abi(), arguments.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<::windows::core::HSTRING>>(result__) } } #[cfg(all(feature = "Foundation", feature = "Storage_Streams", feature = "Web_UI"))] pub fn CapturePreviewToStreamAsync<'a, Param0: ::windows::core::IntoParam<'a, super::super::Storage::Streams::IRandomAccessStream>>(&self, stream: Param0) -> ::windows::core::Result<super::super::Foundation::IAsyncAction> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).25)(::core::mem::transmute_copy(this), stream.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::IAsyncAction>(result__) } } #[cfg(all(feature = "ApplicationModel_DataTransfer", feature = "Foundation", feature = "Web_UI"))] pub fn CaptureSelectedContentToDataPackageAsync(&self) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::DataTransfer::DataPackage>> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).26)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<super::super::ApplicationModel::DataTransfer::DataPackage>>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn BuildLocalStreamUri<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>, Param1: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(&self, contentidentifier: Param0, relativepath: Param1) -> ::windows::core::Result<super::super::Foundation::Uri> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).27)(::core::mem::transmute_copy(this), contentidentifier.into_param().abi(), relativepath.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::Uri>(result__) } } #[cfg(feature = "Web_UI")] pub fn GetDeferredPermissionRequestById(&self, id: u32, result: &mut ::core::option::Option<super::super::Web::UI::WebViewControlDeferredPermissionRequest>) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).28)(::core::mem::transmute_copy(this), id, result as *mut _ as _).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn NavigationStarting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlNavigationStartingEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).29)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveNavigationStarting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).30)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn ContentLoading<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlContentLoadingEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).31)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveContentLoading<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).32)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn DOMContentLoaded<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlDOMContentLoadedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).33)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveDOMContentLoaded<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).34)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn NavigationCompleted<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlNavigationCompletedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).35)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveNavigationCompleted<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).36)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn FrameNavigationStarting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlNavigationStartingEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).37)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveFrameNavigationStarting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).38)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn FrameContentLoading<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlContentLoadingEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).39)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveFrameContentLoading<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).40)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn FrameDOMContentLoaded<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlDOMContentLoadedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).41)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveFrameDOMContentLoaded<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).42)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn FrameNavigationCompleted<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlNavigationCompletedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).43)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveFrameNavigationCompleted<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).44)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn ScriptNotify<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlScriptNotifyEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).45)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveScriptNotify<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).46)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn LongRunningScriptDetected<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlLongRunningScriptDetectedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).47)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveLongRunningScriptDetected<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).48)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn UnsafeContentWarningDisplaying<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, ::windows::core::IInspectable>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).49)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveUnsafeContentWarningDisplaying<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).50)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn UnviewableContentIdentified<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlUnviewableContentIdentifiedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).51)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveUnviewableContentIdentified<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).52)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn PermissionRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlPermissionRequestedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).53)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemovePermissionRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).54)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn UnsupportedUriSchemeIdentified<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlUnsupportedUriSchemeIdentifiedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).55)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveUnsupportedUriSchemeIdentified<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).56)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn NewWindowRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlNewWindowRequestedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).57)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveNewWindowRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).58)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn ContainsFullScreenElementChanged<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, ::windows::core::IInspectable>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).59)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveContainsFullScreenElementChanged<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).60)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn WebResourceRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<super::super::Web::UI::IWebViewControl, super::super::Web::UI::WebViewControlWebResourceRequestedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).61)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(all(feature = "Foundation", feature = "Web_UI"))] pub fn RemoveWebResourceRequested<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl>(self)?; unsafe { (::windows::core::Interface::vtable(this).62)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } pub fn ApplicationViewId(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } #[cfg(feature = "Foundation")] pub fn Closed<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<WebUIView, ::windows::core::IInspectable>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = self; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(feature = "Foundation")] pub fn RemoveClosed<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation"))] pub fn Activated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::TypedEventHandler<WebUIView, super::super::ApplicationModel::Activation::IActivatedEventArgs>>>(&self, handler: Param0) -> ::windows::core::Result<super::super::Foundation::EventRegistrationToken> { let this = self; unsafe { let mut result__: super::super::Foundation::EventRegistrationToken = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), handler.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::EventRegistrationToken>(result__) } } #[cfg(feature = "Foundation")] pub fn RemoveActivated<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::EventRegistrationToken>>(&self, token: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), token.into_param().abi()).ok() } } pub fn IgnoreApplicationContentUriRulesNavigationRestrictions(&self) -> ::windows::core::Result<bool> { let this = self; unsafe { let mut result__: bool = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), &mut result__).from_abi::<bool>(result__) } } pub fn SetIgnoreApplicationContentUriRulesNavigationRestrictions(&self, value: bool) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), value).ok() } } #[cfg(feature = "Web_UI")] pub fn AddInitializeScript<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::HSTRING>>(&self, script: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<super::super::Web::UI::IWebViewControl2>(self)?; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), script.into_param().abi()).ok() } } #[cfg(feature = "Foundation")] pub fn CreateAsync() -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<WebUIView>> { Self::IWebUIViewStatics(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<WebUIView>>(result__) }) } #[cfg(feature = "Foundation")] pub fn CreateWithUriAsync<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::Uri>>(uri: Param0) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<WebUIView>> { Self::IWebUIViewStatics(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), uri.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::IAsyncOperation<WebUIView>>(result__) }) } pub fn IWebUIViewStatics<R, F: FnOnce(&IWebUIViewStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<WebUIView, IWebUIViewStatics> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } } unsafe impl ::windows::core::RuntimeType for WebUIView { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIView;{6783f64f-52da-4fd7-be69-8ef6284b423c})"); } unsafe impl ::windows::core::Interface for WebUIView { type Vtable = IWebUIView_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6783f64f_52da_4fd7_be69_8ef6284b423c); } impl ::windows::core::RuntimeName for WebUIView { const NAME: &'static str = "Windows.UI.WebUI.WebUIView"; } impl ::core::convert::From<WebUIView> for ::windows::core::IUnknown { fn from(value: WebUIView) -> Self { value.0 .0 } } impl ::core::convert::From<&WebUIView> for ::windows::core::IUnknown { fn from(value: &WebUIView) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<WebUIView> for ::windows::core::IInspectable { fn from(value: WebUIView) -> Self { value.0 } } impl ::core::convert::From<&WebUIView> for ::windows::core::IInspectable { fn from(value: &WebUIView) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Web_UI")] impl ::core::convert::TryFrom<WebUIView> for super::super::Web::UI::IWebViewControl { type Error = ::windows::core::Error; fn try_from(value: WebUIView) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "Web_UI")] impl ::core::convert::TryFrom<&WebUIView> for super::super::Web::UI::IWebViewControl { type Error = ::windows::core::Error; fn try_from(value: &WebUIView) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "Web_UI")] impl<'a> ::windows::core::IntoParam<'a, super::super::Web::UI::IWebViewControl> for WebUIView { fn into_param(self) -> ::windows::core::Param<'a, super::super::Web::UI::IWebViewControl> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "Web_UI")] impl<'a> ::windows::core::IntoParam<'a, super::super::Web::UI::IWebViewControl> for &WebUIView { fn into_param(self) -> ::windows::core::Param<'a, super::super::Web::UI::IWebViewControl> { ::core::convert::TryInto::<super::super::Web::UI::IWebViewControl>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "Web_UI")] impl ::core::convert::TryFrom<WebUIView> for super::super::Web::UI::IWebViewControl2 { type Error = ::windows::core::Error; fn try_from(value: WebUIView) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "Web_UI")] impl ::core::convert::TryFrom<&WebUIView> for super::super::Web::UI::IWebViewControl2 { type Error = ::windows::core::Error; fn try_from(value: &WebUIView) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "Web_UI")] impl<'a> ::windows::core::IntoParam<'a, super::super::Web::UI::IWebViewControl2> for WebUIView { fn into_param(self) -> ::windows::core::Param<'a, super::super::Web::UI::IWebViewControl2> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "Web_UI")] impl<'a> ::windows::core::IntoParam<'a, super::super::Web::UI::IWebViewControl2> for &WebUIView { fn into_param(self) -> ::windows::core::Param<'a, super::super::Web::UI::IWebViewControl2> { ::core::convert::TryInto::<super::super::Web::UI::IWebViewControl2>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIVoiceCommandActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIVoiceCommandActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Media_SpeechRecognition"))] pub fn Result(&self) -> ::windows::core::Result<super::super::Media::SpeechRecognition::SpeechRecognitionResult> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Media::SpeechRecognition::SpeechRecognitionResult>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIVoiceCommandActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIVoiceCommandActivatedEventArgs;{ab92dcfd-8d43-4de6-9775-20704b581b00})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIVoiceCommandActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xab92dcfd_8d43_4de6_9775_20704b581b00); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIVoiceCommandActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIVoiceCommandActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIVoiceCommandActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIVoiceCommandActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIVoiceCommandActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIVoiceCommandActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIVoiceCommandActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIVoiceCommandActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIVoiceCommandActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIVoiceCommandActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs { fn from(value: WebUIVoiceCommandActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs { fn from(value: &WebUIVoiceCommandActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs> for &WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IVoiceCommandActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIVoiceCommandActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIVoiceCommandActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIVoiceCommandActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIVoiceCommandActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIVoiceCommandActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIWalletActionActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIWalletActionActivatedEventArgs { #[cfg(feature = "ApplicationModel_Activation")] pub fn ItemId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "ApplicationModel_Wallet"))] pub fn ActionKind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Wallet::WalletActionKind> { let this = self; unsafe { let mut result__: super::super::ApplicationModel::Wallet::WalletActionKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Wallet::WalletActionKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn ActionId(&self) -> ::windows::core::Result<::windows::core::HSTRING> { let this = self; unsafe { let mut result__: ::core::mem::ManuallyDrop<::windows::core::HSTRING> = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<::windows::core::HSTRING>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIWalletActionActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIWalletActionActivatedEventArgs;{fcfc027b-1a1a-4d22-923f-ae6f45fa52d9})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIWalletActionActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfcfc027b_1a1a_4d22_923f_ae6f45fa52d9); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIWalletActionActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIWalletActionActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWalletActionActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIWalletActionActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWalletActionActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIWalletActionActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWalletActionActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIWalletActionActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWalletActionActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIWalletActionActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWalletActionActivatedEventArgs> for super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs { fn from(value: WebUIWalletActionActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWalletActionActivatedEventArgs> for super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs { fn from(value: &WebUIWalletActionActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs> for WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs> for &WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWalletActionActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWalletActionActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIWalletActionActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWalletActionActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIWalletActionActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWalletActionActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIWalletActionActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWalletActionActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIWalletActionActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIWalletActionActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIWebAccountProviderActivatedEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIWebAccountProviderActivatedEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Security_Authentication_Web_Provider"))] pub fn Operation(&self) -> ::windows::core::Result<super::super::Security::Authentication::Web::Provider::IWebAccountProviderOperation> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Security::Authentication::Web::Provider::IWebAccountProviderOperation>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "System"))] pub fn User(&self) -> ::windows::core::Result<super::super::System::User> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::System::User>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIWebAccountProviderActivatedEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIWebAccountProviderActivatedEventArgs;{72b71774-98ea-4ccf-9752-46d9051004f1})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIWebAccountProviderActivatedEventArgs { type Vtable = super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x72b71774_98ea_4ccf_9752_46d9051004f1); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIWebAccountProviderActivatedEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIWebAccountProviderActivatedEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAccountProviderActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIWebAccountProviderActivatedEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAccountProviderActivatedEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIWebAccountProviderActivatedEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAccountProviderActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIWebAccountProviderActivatedEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAccountProviderActivatedEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIWebAccountProviderActivatedEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs { fn from(value: WebUIWebAccountProviderActivatedEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs { fn from(value: &WebUIWebAccountProviderActivatedEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs> for &WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWebAccountProviderActivatedEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAccountProviderActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAccountProviderActivatedEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAccountProviderActivatedEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAccountProviderActivatedEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> for &WebUIWebAccountProviderActivatedEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgsWithUser>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct WebUIWebAuthenticationBrokerContinuationEventArgs(pub ::windows::core::IInspectable); #[cfg(feature = "ApplicationModel_Activation")] impl WebUIWebAuthenticationBrokerContinuationEventArgs { #[cfg(all(feature = "ApplicationModel_Activation", feature = "Security_Authentication_Web"))] pub fn WebAuthenticationResult(&self) -> ::windows::core::Result<super::super::Security::Authentication::Web::WebAuthenticationResult> { let this = self; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Security::Authentication::Web::WebAuthenticationResult>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn Kind(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ActivationKind> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ActivationKind = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ActivationKind>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn PreviousExecutionState(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::ApplicationExecutionState> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: super::super::ApplicationModel::Activation::ApplicationExecutionState = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::ApplicationExecutionState>(result__) } } #[cfg(feature = "ApplicationModel_Activation")] pub fn SplashScreen(&self) -> ::windows::core::Result<super::super::ApplicationModel::Activation::SplashScreen> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::ApplicationModel::Activation::SplashScreen>(result__) } } #[cfg(all(feature = "ApplicationModel_Activation", feature = "Foundation_Collections"))] pub fn ContinuationData(&self) -> ::windows::core::Result<super::super::Foundation::Collections::ValueSet> { let this = &::windows::core::Interface::cast::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::Foundation::Collections::ValueSet>(result__) } } pub fn ActivatedOperation(&self) -> ::windows::core::Result<ActivatedOperation> { let this = &::windows::core::Interface::cast::<IActivatedEventArgsDeferral>(self)?; unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<ActivatedOperation>(result__) } } } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::RuntimeType for WebUIWebAuthenticationBrokerContinuationEventArgs { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.WebUI.WebUIWebAuthenticationBrokerContinuationEventArgs;{75dda3d4-7714-453d-b7ff-b95e3a1709da})"); } #[cfg(feature = "ApplicationModel_Activation")] unsafe impl ::windows::core::Interface for WebUIWebAuthenticationBrokerContinuationEventArgs { type Vtable = super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x75dda3d4_7714_453d_b7ff_b95e3a1709da); } #[cfg(feature = "ApplicationModel_Activation")] impl ::windows::core::RuntimeName for WebUIWebAuthenticationBrokerContinuationEventArgs { const NAME: &'static str = "Windows.UI.WebUI.WebUIWebAuthenticationBrokerContinuationEventArgs"; } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAuthenticationBrokerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { value.0 .0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAuthenticationBrokerContinuationEventArgs> for ::windows::core::IUnknown { fn from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { value.0 .0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAuthenticationBrokerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { value.0 } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAuthenticationBrokerContinuationEventArgs> for ::windows::core::IInspectable { fn from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { value.0.clone() } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs { fn from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::From<&WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs { fn from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs> for &WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IWebAuthenticationBrokerContinuationEventArgs> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> for &WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAuthenticationBrokerContinuationEventArgs> for super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> for &WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs> { ::core::convert::TryInto::<super::super::ApplicationModel::Activation::IContinuationActivatedEventArgs>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<WebUIWebAuthenticationBrokerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::core::convert::TryFrom::try_from(&value) } } #[cfg(feature = "ApplicationModel_Activation")] impl ::core::convert::TryFrom<&WebUIWebAuthenticationBrokerContinuationEventArgs> for IActivatedEventArgsDeferral { type Error = ::windows::core::Error; fn try_from(value: &WebUIWebAuthenticationBrokerContinuationEventArgs) -> ::windows::core::Result<Self> { ::windows::core::Interface::cast(value) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::windows::core::IntoParam::into_param(&self) } } #[cfg(feature = "ApplicationModel_Activation")] impl<'a> ::windows::core::IntoParam<'a, IActivatedEventArgsDeferral> for &WebUIWebAuthenticationBrokerContinuationEventArgs { fn into_param(self) -> ::windows::core::Param<'a, IActivatedEventArgsDeferral> { ::core::convert::TryInto::<IActivatedEventArgsDeferral>::try_into(self).map(::windows::core::Param::Owned).unwrap_or(::windows::core::Param::None) } }
use std::io::{self, Write}; mod ast; mod evaluator; mod lexer; mod object; mod parser; mod token; use evaluator::*; use lexer::*; use object::*; use parser::*; fn main() -> io::Result<()> { let mut env = Environment::new(); let prompt = ">>"; println!( "Hello mrnugget! This is the Monkey programming language!\nFeel free to type in commands" ); loop { print!("{} ", prompt); let mut input = String::new(); let _ = io::stdout().flush(); // needed since prompt does not contain a new line char io::stdin().read_line(&mut input)?; if input.is_empty() { return Ok(()); } let l = Lexer::new(input.chars().collect()); let mut p = Parser::new(l); let program = p.parse_program(); const MONKEY_ART: &str = r#" ┈┈┈┈┈┈┈┈┈┈┈????????????? ┈┈╱▔▔▔▔▔╲┈┈┈?????????? ┈╱┈┈╱▔╲╲╲▏┈┈┈?????┈ ╱┈┈╱━╱▔▔▔▔▔╲━╮┈┈ ▏┈▕┃▕╱▔╲╱▔╲▕╮┃┈┈ ▏┈▕╰━▏▊▕▕▋▕▕━╯┈┈ ╲┈┈╲╱▔╭╮▔▔┳╲╲┈┈┈ ┈╲┈┈▏╭━━━━╯▕▕┈┈┈ ┈┈╲┈╲▂▂▂▂▂▂╱╱┈┈┈ ┈┈┈┈▏┊┈┈┈┈┊┈┈┈╲┈ ┈┈┈┈▏┊┈┈┈┈┊▕╲┈┈╲ ┈╱▔╲▏┊┈┈┈┈┊▕╱▔╲▕ ┈▏┈┈┈╰┈┈┈┈╯┈┈┈▕▕ ┈╲┈┈┈╲┈┈┈┈╱┈┈┈╱┈╲ ┈┈╲┈┈▕▔▔▔▔▏┈┈╱╲╲╲▏ ┈╱▔┈┈▕┈┈┈┈▏┈┈▔╲▔▔ ┈╲▂▂▂╱┈┈┈┈╲▂▂▂╱┈ "#; if !program.errors.is_empty() { println!("{}", MONKEY_ART); println!("Woops! We ran into some monkey business here!"); println!(" parser errors:"); print_parser_errors(&program.errors); continue; } let evaluated = eval(program, &mut env); if let Ok(obj) = evaluated { match obj { Object::Null => (), _ => println!("{}", obj.inspect()), } } } } fn print_parser_errors(errors: &Vec<String>) { for e in errors.iter() { println!("\t{}", e); } }
#[macro_use] extern crate log; extern crate log4rs; static CONFIG: &'static str = " appenders: main: kind: console root: level: warn appenders: - main loggers: log4rs_issue: level: debug log4rs_issue::nested: level: trace "; mod nested { pub fn calls_trace() { trace!("calls_trace"); } } fn main() { // Init using default, stdout logging. let creator = Default::default(); let config = log4rs::file::Config::parse(CONFIG, ::log4rs::file::Format::Yaml, &creator) .expect("default config is valid") .into_config(); log4rs::init_config(config).unwrap(); debug!("main"); nested::calls_trace(); }
#![cfg_attr(feature = "bench", feature(test))] #![feature(nll)] #![feature(test)] #![feature(external_doc)] #![doc(include = "../README.md")] #![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")] //! Note that docs will only build on nightly Rust until //! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732). extern crate byteorder; extern crate curve25519_dalek; extern crate rand; extern crate sha2; extern crate subtle; extern crate tiny_keccak; #[macro_use] extern crate serde_derive; #[cfg(test)] extern crate test; #[cfg(test)] extern crate bincode; mod util; #[doc(include = "../docs/notes.md")] mod notes {} mod generators; mod inner_product_proof; mod proof_transcript; mod range_proof; pub use generators::{Generators, GeneratorsView, PedersenGenerators}; pub use proof_transcript::ProofTranscript; pub use range_proof::RangeProof; #[doc(include = "../docs/aggregation-api.md")] pub mod aggregation { pub use range_proof::dealer; pub use range_proof::messages; pub use range_proof::party; }
use super::*; use bitflags::bitflags; use linux_object::time::*; impl Syscall<'_> { #[cfg(target_arch = "x86_64")] /// set architecture-specific thread state /// for x86_64 currently pub fn sys_arch_prctl(&mut self, code: i32, addr: usize) -> SysResult { const ARCH_SET_FS: i32 = 0x1002; match code { ARCH_SET_FS => { info!("sys_arch_prctl: set FSBASE to {:#x}", addr); self.regs.fsbase = addr; Ok(0) } _ => Err(LxError::EINVAL), } } /// get name and information about current kernel pub fn sys_uname(&self, buf: UserOutPtr<u8>) -> SysResult { info!("uname: buf={:?}", buf); #[cfg(not(target_arch = "riscv64"))] let strings = ["Linux", "orz", "0.1.0", "1", "machine", "domain"]; #[cfg(target_arch = "riscv64")] let strings = ["Linux", "@zCore", "0.1.0", "1", "riscv64", "oslab"]; for (i, &s) in strings.iter().enumerate() { const OFFSET: usize = 65; buf.add(i * OFFSET).write_cstring(s)?; } Ok(0) } /// provides a simple way of getting overall system statistics pub fn sys_sysinfo(&mut self, mut sys_info: UserOutPtr<SysInfo>) -> SysResult { let sysinfo = SysInfo::default(); sys_info.write(sysinfo)?; Ok(0) } /// provides a method for waiting until a certain condition becomes true. /// - `uaddr` - points to the futex word. /// - `op` - the operation to perform on the futex /// - `val` - a value whose meaning and purpose depends on op /// - `timeout` - not support now /// TODO: support timeout pub async fn sys_futex( &self, uaddr: usize, op: u32, val: i32, timeout: UserInPtr<TimeSpec>, ) -> SysResult { let op = FutexFlags::from_bits_truncate(op); info!( "futex: uaddr: {:#x}, op: {:?}, val: {}, timeout_ptr: {:?}", uaddr, op, val, timeout ); if op.contains(FutexFlags::PRIVATE) { warn!("process-shared futex is unimplemented"); } let futex = self.linux_process().get_futex(uaddr); match op.bits & 0xf { 0 => { // FIXME: support timeout let _timeout = timeout.read_if_not_null()?; match futex.wait(val).await { Ok(_) => Ok(0), Err(ZxError::BAD_STATE) => Err(LxError::EAGAIN), Err(e) => Err(e.into()), } } 1 => { let woken_up_count = futex.wake(val as usize); Ok(woken_up_count) } _ => { warn!("unsupported futex operation: {:?}", op); Err(LxError::ENOSYS) } } } /// Combines and extends the functionality of setrlimit() and getrlimit() pub fn sys_prlimit64( &mut self, pid: usize, resource: usize, new_limit: UserInPtr<RLimit>, mut old_limit: UserOutPtr<RLimit>, ) -> SysResult { info!( "prlimit64: pid: {}, resource: {}, new_limit: {:x?}, old_limit: {:x?}", pid, resource, new_limit, old_limit ); let proc = self.linux_process(); match resource { RLIMIT_STACK => { old_limit.write_if_not_null(RLimit { cur: USER_STACK_SIZE as u64, max: USER_STACK_SIZE as u64, })?; Ok(0) } RLIMIT_NOFILE => { let new_limit = new_limit.read_if_not_null()?; old_limit.write_if_not_null(proc.file_limit(new_limit))?; Ok(0) } RLIMIT_RSS | RLIMIT_AS => { old_limit.write_if_not_null(RLimit { cur: 1024 * 1024 * 1024, max: 1024 * 1024 * 1024, })?; Ok(0) } _ => Err(LxError::ENOSYS), } } #[allow(unsafe_code)] /// fills the buffer pointed to by `buf` with up to `buflen` random bytes. /// - `buf` - buffer that needed to fill /// - `buflen` - length of buffer /// - `flag` - a bit mask that can contain zero or more of the following values ORed together: /// - GRND_RANDOM /// - GRND_NONBLOCK /// - returns the number of bytes that were copied to the buffer buf. pub fn sys_getrandom(&mut self, mut buf: UserOutPtr<u8>, len: usize, flag: u32) -> SysResult { info!("getrandom: buf: {:?}, len: {:?}, flag {:?}", buf, len, flag); let mut buffer = vec![0u8; len]; kernel_hal::fill_random(&mut buffer); buf.write_array(&buffer[..len])?; Ok(len) } } bitflags! { /// for op argument in futex() struct FutexFlags: u32 { /// tests that the value at the futex word pointed /// to by the address uaddr still contains the expected value val, /// and if so, then sleeps waiting for a FUTEX_WAKE operation on the futex word. const WAIT = 0; /// wakes at most val of the waiters that are waiting on the futex word at the address uaddr. const WAKE = 1; /// can be employed with all futex operations, tells the kernel that the futex is process-private and not shared with another process const PRIVATE = 0x80; } } const USER_STACK_SIZE: usize = 8 * 1024 * 1024; // 8 MB, the default config of Linux const RLIMIT_STACK: usize = 3; const RLIMIT_RSS: usize = 5; const RLIMIT_NOFILE: usize = 7; const RLIMIT_AS: usize = 9; /// sysinfo() return information sturct #[repr(C)] #[derive(Debug, Default)] pub struct SysInfo { /// Seconds since boot uptime: u64, /// 1, 5, and 15 minute load averages loads: [u64; 3], /// Total usable main memory size totalram: u64, /// Available memory size freeram: u64, /// Amount of shared memory sharedram: u64, /// Memory used by buffers bufferram: u64, /// Total swa Total swap space sizep space size totalswap: u64, /// swap space still available freeswap: u64, /// Number of current processes procs: u16, /// Total high memory size totalhigh: u64, /// Available high memory size freehigh: u64, /// Memory unit size in bytes mem_unit: u32, }
extern crate windows_winmd as winmd; #[test] fn win32() { let reader = winmd::TypeReader::get(); if let winmd::Type::TypeDef(def) = reader.expect_type(("Windows.Foundation", "IStringable")) { assert!(def.name() == ("Windows.Foundation", "IStringable")); } else { panic!(); } if let winmd::Type::MethodDef((def, method)) = reader.expect_type(("Windows.Win32.SystemServices", "CreateEventW")) { assert!(def.name() == ("Windows.Win32.SystemServices", "Apis")); assert!(method.name() == "CreateEventW"); } else { panic!(); } if let winmd::Type::Field((def, field)) = reader.expect_type(("Windows.Win32.SystemServices", "WM_KEYDOWN")) { assert!(def.name() == ("Windows.Win32.SystemServices", "Apis")); assert!(field.name() == "WM_KEYDOWN"); } else { panic!(); } }
use crate::random::GameRandom; use game_lib::rand::SeedableRng; #[derive(Clone, Debug, Default)] pub struct RandomConfig { pub seed: Option<<GameRandom as SeedableRng>::Seed>, }
mod with_atom_module; use proptest::strategy::Just; use crate::erlang::spawn_3; use crate::test::strategy; #[test] fn without_atom_module_errors_badarg() { run!( |arc_process| { ( Just(arc_process.clone()), strategy::term::is_not_atom(arc_process.clone()), strategy::term::atom(), strategy::term::list::proper(arc_process.clone()), ) }, |(arc_process, module, function, arguments)| { prop_assert_is_not_atom!( spawn_3::result(&arc_process, module, function, arguments), module ); Ok(()) }, ); }
// Copyright 2018 The Exonum Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. extern crate exonum; extern crate rates; #[macro_use] extern crate serde_derive; extern crate toml; use exonum::blockchain::{GenesisConfig, ConsensusConfig, ValidatorKeys}; use exonum::node::{Node, NodeApiConfig, NodeConfig, MemoryPoolConfig, ConnectInfo, ConnectListConfig}; use exonum::storage::{RocksDB, DbOptions}; use exonum::crypto::{PublicKey, SecretKey}; use exonum::events::{NetworkConfiguration}; use rates::service::{RatesService}; use std::fs::File; use std::io::prelude::*; use std::net::SocketAddr; use std::path::Path; #[derive(Deserialize, Debug)] struct TNodeConfig { database_path: String, external_address: Option<SocketAddr>, listen_address: SocketAddr, peers: Vec<SocketAddr>, consensus_public_key: PublicKey, consensus_secret_key: SecretKey, service_public_key: PublicKey, service_secret_key: SecretKey, network: TNetworkConfig, api: TApiConfig, mempool: TMempoolConfig, genesis: TGenesisConfig, consensus: TConsensusConfig, connect_list: TConnectList, } #[derive(Deserialize, Debug)] struct TNetworkConfig { max_incoming_connections: usize, max_outgoing_connections: usize, tcp_nodelay: bool, tcp_connect_retry_timeout: u64, tcp_connect_max_retries: u64 } #[derive(Deserialize, Debug)] struct TApiConfig { enable_blockchain_explorer: bool, state_update_timeout: usize, public_api_address: Option<SocketAddr>, private_api_address: Option<SocketAddr> } #[derive(Deserialize, Debug)] struct TMempoolConfig { tx_pool_capacity: usize, } #[derive(Deserialize, Debug)] struct TGenesisConfig { validator_keys: Vec<ValidatorKeys>, } #[derive(Deserialize, Debug)] struct TConsensusConfig { max_message_len: u32, max_propose_timeout: u64, min_propose_timeout: u64, peers_timeout: u64, propose_timeout_threshold: u32, round_timeout: u64, status_timeout: u64, txs_block_limit: u32 } #[derive(Deserialize, Debug)] struct TConnectList { peers: Vec<ConnectInfo> } fn main() { exonum::helpers::init_logger().unwrap(); let args: Vec<String> = std::env::args().collect(); let filename = &args[1]; println!("Config file is: {}", filename); let mut f = File::open(filename).expect("file not found"); let mut content = String::new(); f.read_to_string(&mut content) .expect("something went wrong reading the file"); let node_conf: TNodeConfig = toml::from_str(&content).unwrap(); println!("TNodeConfig: {:?}", node_conf); let db_path = node_conf.database_path.clone(); println!("Database path: {}", db_path); let db_path = Path::new(&db_path); let options = DbOptions::default(); let database = match RocksDB::open(db_path, &options) { Ok(db) => {db}, Err(e) => { panic!("Failed to open database: {:?}", e); } }; let consensus_config = ConsensusConfig { round_timeout: node_conf.consensus.round_timeout, status_timeout: node_conf.consensus.status_timeout, peers_timeout: node_conf.consensus.peers_timeout, txs_block_limit: node_conf.consensus.txs_block_limit, max_message_len: node_conf.consensus.max_message_len, min_propose_timeout: node_conf.consensus.min_propose_timeout, max_propose_timeout: node_conf.consensus.max_propose_timeout, propose_timeout_threshold: node_conf.consensus.propose_timeout_threshold }; let genesis_conf = GenesisConfig { consensus: consensus_config, validator_keys: node_conf.genesis.validator_keys }; let api_conf = NodeApiConfig { state_update_timeout: node_conf.api.state_update_timeout, enable_blockchain_explorer: node_conf.api.enable_blockchain_explorer, public_api_address: node_conf.api.public_api_address, private_api_address: node_conf.api.private_api_address, ..Default::default() }; let network_conf = NetworkConfiguration { max_incoming_connections: node_conf.network.max_incoming_connections, max_outgoing_connections: node_conf.network.max_outgoing_connections, tcp_nodelay: node_conf.network.tcp_nodelay, tcp_keep_alive: None, tcp_connect_retry_timeout: node_conf.network.tcp_connect_retry_timeout, tcp_connect_max_retries: node_conf.network.tcp_connect_max_retries }; let mempool_conf = MemoryPoolConfig { tx_pool_capacity: node_conf.mempool.tx_pool_capacity, ..Default::default() }; let conn_list_conf = ConnectListConfig { peers: node_conf.connect_list.peers }; let config = NodeConfig { genesis: genesis_conf, listen_address: node_conf.listen_address, external_address: node_conf.external_address, network: network_conf, consensus_public_key: node_conf.consensus_public_key, consensus_secret_key: node_conf.consensus_secret_key, service_public_key: node_conf.service_public_key, service_secret_key: node_conf.service_secret_key, api: api_conf, mempool: mempool_conf, services_configs: Default::default(), database: Default::default(), connect_list: conn_list_conf, }; let node = Node::new( database, vec![Box::new(RatesService)], config, Some(node_conf.database_path), ); println!("Starting a single node..."); println!("Blockchain is ready for transactions!"); node.run().unwrap(); }
use crate::collections::HashMap; use crate::context::Handler; use crate::{ConstValue, Hash, Item, TypeCheck}; use std::fmt; use std::sync::Arc; /// Static run context visible to the virtual machine. /// /// This contains: /// * Declared functions. /// * Declared instance functions. /// * Built-in type checks. #[derive(Default)] pub struct RuntimeContext { /// Registered native function handlers. pub(crate) functions: HashMap<Hash, Arc<Handler>>, /// Registered types. pub(crate) types: HashMap<Hash, TypeCheck>, /// Named constant values pub(crate) constants: HashMap<Hash, ConstValue>, } impl RuntimeContext { /// Construct a new empty collection of functions. pub fn new() -> Self { Self::default() } /// Use the specified type check. pub fn type_check_for(&self, item: &Item) -> Option<TypeCheck> { Some(*self.types.get(&Hash::type_hash(item))?) } /// Lookup the given native function handler in the context. pub fn lookup(&self, hash: Hash) -> Option<&Arc<Handler>> { self.functions.get(&hash) } /// Read a constant value from the unit. pub fn constant(&self, hash: Hash) -> Option<&ConstValue> { self.constants.get(&hash) } } impl fmt::Debug for RuntimeContext { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "RuntimeContext") } } #[cfg(test)] static_assertions::assert_impl_all!(RuntimeContext: Send, Sync);
use crate::responses::listing::GenericListing; use crate::responses::{FullName, GenericResponse}; use serde::Deserialize; use serde_json::Value; #[derive(Deserialize, Debug)] pub struct Message { pub associated_awarding_id: Option<Value>, pub author: String, pub author_fullname: Option<FullName>, pub body: Option<String>, pub body_html: Option<String>, pub context: Option<String>, pub created: f64, pub created_utc: f64, pub dest: Option<String>, pub distinguished: Option<String>, pub first_message: Option<Value>, pub first_message_name: Option<Value>, pub id: String, pub likes: Option<bool>, pub name: String, pub new: Option<bool>, pub num_comments: Option<Value>, pub parent_id: Option<Value>, pub replies: Option<String>, pub score: f64, pub subject: String, pub subreddit: Option<String>, pub subreddit_name_prefixed: Option<String>, #[serde(rename(deserialize = "type"))] pub type_: Option<String>, #[serde(default)] pub was_comment: bool, } /// About with a GenericResponse Wrap pub type MessageResponse = GenericResponse<Message>; /// A listing of user abouts pub type MessageListing = GenericListing<Message>;
#[doc = "Reader of register HWCFGR6"] pub type R = crate::R<u32, super::HWCFGR6>; #[doc = "Writer for register HWCFGR6"] pub type W = crate::W<u32, super::HWCFGR6>; #[doc = "Register HWCFGR6 `reset()`'s with value 0x1f1f_1f1f"] impl crate::ResetValue for super::HWCFGR6 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0x1f1f_1f1f } } #[doc = "Reader of field `CHMAP20`"] pub type CHMAP20_R = crate::R<u8, u8>; #[doc = "Write proxy for field `CHMAP20`"] pub struct CHMAP20_W<'a> { w: &'a mut W, } impl<'a> CHMAP20_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); self.w } } #[doc = "Reader of field `CHMAP21`"] pub type CHMAP21_R = crate::R<u8, u8>; #[doc = "Write proxy for field `CHMAP21`"] pub struct CHMAP21_W<'a> { w: &'a mut W, } impl<'a> CHMAP21_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x1f << 8)) | (((value as u32) & 0x1f) << 8); self.w } } #[doc = "Reader of field `CHMAP22`"] pub type CHMAP22_R = crate::R<u8, u8>; #[doc = "Write proxy for field `CHMAP22`"] pub struct CHMAP22_W<'a> { w: &'a mut W, } impl<'a> CHMAP22_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x1f << 16)) | (((value as u32) & 0x1f) << 16); self.w } } #[doc = "Reader of field `CHMAP23`"] pub type CHMAP23_R = crate::R<u8, u8>; #[doc = "Write proxy for field `CHMAP23`"] pub struct CHMAP23_W<'a> { w: &'a mut W, } impl<'a> CHMAP23_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x1f << 24)) | (((value as u32) & 0x1f) << 24); self.w } } impl R { #[doc = "Bits 0:4 - Input channel mapping"] #[inline(always)] pub fn chmap20(&self) -> CHMAP20_R { CHMAP20_R::new((self.bits & 0x1f) as u8) } #[doc = "Bits 8:12 - Input channel mapping"] #[inline(always)] pub fn chmap21(&self) -> CHMAP21_R { CHMAP21_R::new(((self.bits >> 8) & 0x1f) as u8) } #[doc = "Bits 16:20 - Input channel mapping"] #[inline(always)] pub fn chmap22(&self) -> CHMAP22_R { CHMAP22_R::new(((self.bits >> 16) & 0x1f) as u8) } #[doc = "Bits 24:28 - Input channel mapping"] #[inline(always)] pub fn chmap23(&self) -> CHMAP23_R { CHMAP23_R::new(((self.bits >> 24) & 0x1f) as u8) } } impl W { #[doc = "Bits 0:4 - Input channel mapping"] #[inline(always)] pub fn chmap20(&mut self) -> CHMAP20_W { CHMAP20_W { w: self } } #[doc = "Bits 8:12 - Input channel mapping"] #[inline(always)] pub fn chmap21(&mut self) -> CHMAP21_W { CHMAP21_W { w: self } } #[doc = "Bits 16:20 - Input channel mapping"] #[inline(always)] pub fn chmap22(&mut self) -> CHMAP22_W { CHMAP22_W { w: self } } #[doc = "Bits 24:28 - Input channel mapping"] #[inline(always)] pub fn chmap23(&mut self) -> CHMAP23_W { CHMAP23_W { w: self } } }
pub use pathfinding_data::*; use game::*; use std::marker::PhantomData; pub fn pathfind<T1, State, T: Node<T1, State>>(game: &Game1, settings: &PathfindingSettings, state: &mut PathfindingState<T1, State, T>, poly_state: &mut State, target_node: T)->Result<T1,bool>{ //Returns either a path or err(should_continue_searching) let mut iterations=0; loop{ iterations+=1; state.open_nodes.sort_by(|x,y|(sort_func(x, &target_node).partial_cmp(&sort_func(y, &target_node)).expect(format!("NAN in path sort func, relevant stats {} {} {} {}", x.reach_cost(), x.estimate(&target_node), y.reach_cost(), y.estimate(&target_node)).as_str()))); let current_node=state.open_nodes.remove(0); if current_node.is_same(&target_node){ return Ok(current_node.make_path()); } let neighbours=current_node.neighbours(game,poly_state); for neighbour in neighbours{ //first check open nodes let open_index=state.open_nodes.iter().position(|x|x.is_same(&neighbour)); match open_index{ Some(i)=>{ if state.open_nodes[i].reach_cost()<=neighbour.reach_cost() {continue}; state.open_nodes[i]=neighbour; continue; }, _=>{} } let closed_index=state.closed_nodes.iter().position(|x|x.is_same(&neighbour)); match closed_index{ Some(i)=>{ if state.closed_nodes[i].reach_cost()<=neighbour.reach_cost() {continue}; state.closed_nodes.remove(i); state.open_nodes.push(neighbour); continue; }, _=>{} } state.open_nodes.push(neighbour); } state.closed_nodes.push(current_node); if iterations>=settings.max_iterations{ return Err(true); } if state.open_nodes.is_empty() {break}; } Err(false) } impl<T1, State, T: Node<T1, State>> PathfindingState<T1, State, T>{ pub fn from_start(node: T)->Self{ PathfindingState{open_nodes: vec!(node), closed_nodes: Vec::new(), phantom: PhantomData, phantom_state: PhantomData} } } fn sort_func<T1, State, T: Node<T1, State>>(selfy: &T, other: &T)->CostType{ selfy.estimate(other)+selfy.reach_cost() } impl BasicNode{ pub fn get_nearest_target_node(x: f64, y:f64)->BasicNode{ let (sx,sy)=Chunk::get_square_coords_absolute(x,y); BasicNode{x:sx, y:sy, cost:0.0, parent: None} } } impl Node<Vec<BasicNode>, ()> for BasicNode{ fn neighbours(&self,game: &Game1, _: &mut ())->Vec<Self>{ let mut ret=Vec::new(); for i in -1i64..2{ for j in -1i64..2{ if (i.abs()+j.abs())!=1 {continue}; let nx=self.x+i; let ny=self.y+j; let (cx,cy)=Chunk::get_chunk_coords_from_square(nx,ny); let (sx,sy)=Chunk::get_square_coords_from_square(nx,ny); let chunk=game.chunks.get(&(cx,cy)); let neighbour=BasicNode{parent: Some(Box::new(self.clone())), cost: self.cost+1.0, x: nx, y: ny}; if !chunk.is_none()&&chunk.as_ref().unwrap().solid[sy][sx]>0 {continue}; ret.push(neighbour); } } ret } fn reach_cost(&self)->CostType {self.cost} fn estimate(&self, other: &Self)->CostType{ ((self.x-other.x).abs()+(self.y-other.y).abs()) as CostType } fn is_same(&self, other: &Self)->bool{ (self.x==other.x)&&(self.y==other.y) } fn make_path(&self)->Vec<Self>{ let mut ret=Vec::new(); let mut current=self; while !current.parent.is_none(){ ret.push(current.clone()); current=&current.parent.as_ref().unwrap(); } ret.push(current.clone()); ret.reverse(); ret } } impl PathfindingSettings{ pub fn default()->Self{ PathfindingSettings{max_iterations: 100} } }
use serde::{Deserialize, Serialize}; use serde_json::Result; #[derive(Serialize, Deserialize)] pub struct SubscribeCommand { #[serde(rename="id")] id: u64, #[serde(rename="command")] command: String, #[serde(rename="streams")] streams: Vec<String>, } impl SubscribeCommand { pub fn with_params(id: u64, command: String, streams: Vec<String>) -> Box<Self> { Box::new( SubscribeCommand { id: id, command: command, streams: streams, } ) } pub fn to_string(&self) -> Result<String> { let j = serde_json::to_string(&self)?; Ok(j) } } impl Default for SubscribeCommand { fn default() -> Self { SubscribeCommand { id: 0, command: "subscribe".to_string(), streams: vec!["ledger".to_string(),"server".to_string(),"transactions".to_string()], } } } #[derive(Serialize, Deserialize, Debug)] pub struct SubscribeResponse { #[serde(rename="fee_base")] pub fee_base: u64, #[serde(rename="fee_ref")] fee_ref: u64, #[serde(rename="hostid")] hostid: Option<String>, #[serde(rename="ledger_hash")] ledger_hash: String, #[serde(rename="ledger_index")] ledger_index: u64, #[serde(rename="ledger_time")] ledger_time: u64, #[serde(rename="load_base")] load_base: Option<u64>, #[serde(rename="load_factor")] load_factor: Option<u64>, #[serde(rename="pubkey_node")] pubkey_node: Option<String>, #[serde(rename="random")] random: Option<String>, #[serde(rename="reserve_base")] reserve_base: u64, #[serde(rename="reserve_inc")] reserve_inc: u64, #[serde(rename="server_status")] server_status: Option<String>, #[serde(rename="validated_ledgers")] validated_ledgers: String, #[serde(rename="txn_count")] txn_count: Option<u64>, #[serde(rename="type")] ttype: Option<String>, }
struct Person; impl Person { fn hello(&self) { println!("Hello brother"); } } fn main() { let p: Person = Person{}; p.hello(); }
// Copyright 2022 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::collections::HashMap; use std::fmt::Write; use common_exception::ErrorCode; use common_exception::Result; use common_exception::Span; use itertools::Itertools; use crate::expression::Expr; use crate::expression::RawExpr; use crate::function::FunctionRegistry; use crate::function::FunctionSignature; use crate::types::decimal::DecimalSize; use crate::types::DataType; use crate::types::DecimalDataType; use crate::types::Number; use crate::AutoCastRules; use crate::ColumnIndex; use crate::ConstantFolder; use crate::FunctionContext; use crate::Scalar; pub fn check<Index: ColumnIndex>( ast: &RawExpr<Index>, fn_registry: &FunctionRegistry, ) -> Result<Expr<Index>> { match ast { RawExpr::Constant { span, scalar } => Ok(Expr::Constant { span: *span, scalar: scalar.clone(), data_type: scalar.as_ref().infer_data_type(), }), RawExpr::ColumnRef { span, id, data_type, display_name, } => Ok(Expr::ColumnRef { span: *span, id: id.clone(), data_type: data_type.clone(), display_name: display_name.clone(), }), RawExpr::Cast { span, is_try, expr, dest_type, } => { let expr = check(expr, fn_registry)?; check_cast(*span, *is_try, expr, dest_type, fn_registry) } RawExpr::FunctionCall { span, name, args, params, } => { let args_expr: Vec<_> = args .iter() .map(|arg| check(arg, fn_registry)) .try_collect()?; check_function(*span, name, params, &args_expr, fn_registry) } } } pub fn check_cast<Index: ColumnIndex>( span: Span, is_try: bool, expr: Expr<Index>, dest_type: &DataType, fn_registry: &FunctionRegistry, ) -> Result<Expr<Index>> { let wrapped_dest_type = if is_try { wrap_nullable_for_try_cast(span, dest_type)? } else { dest_type.clone() }; if expr.data_type() == &wrapped_dest_type { Ok(expr) } else if expr.data_type().wrap_nullable() == wrapped_dest_type { Ok(Expr::Cast { span, is_try, expr: Box::new(expr), dest_type: wrapped_dest_type, }) } else { // fast path to eval function for cast if let Some(cast_fn) = get_simple_cast_function(is_try, dest_type) { let params = if let DataType::Decimal(ty) = dest_type { vec![ty.precision() as usize, ty.scale() as usize] } else { vec![] }; if let Ok(cast_expr) = check_function(span, &cast_fn, &params, &[expr.clone()], fn_registry) { if cast_expr.data_type() == &wrapped_dest_type { return Ok(cast_expr); } } } Ok(Expr::Cast { span, is_try, expr: Box::new(expr), dest_type: wrapped_dest_type, }) } } pub fn wrap_nullable_for_try_cast(span: Span, ty: &DataType) -> Result<DataType> { match ty { DataType::Null => Err(ErrorCode::from_string_no_backtrace( "TRY_CAST() to NULL is not supported".to_string(), ) .set_span(span)), DataType::Nullable(ty) => wrap_nullable_for_try_cast(span, ty), DataType::Array(inner_ty) => Ok(DataType::Nullable(Box::new(DataType::Array(Box::new( wrap_nullable_for_try_cast(span, inner_ty)?, ))))), DataType::Tuple(fields_ty) => Ok(DataType::Nullable(Box::new(DataType::Tuple( fields_ty .iter() .map(|ty| wrap_nullable_for_try_cast(span, ty)) .collect::<Result<Vec<_>>>()?, )))), _ => Ok(DataType::Nullable(Box::new(ty.clone()))), } } pub fn check_number<Index: ColumnIndex, T: Number>( span: Span, func_ctx: FunctionContext, expr: &Expr<Index>, fn_registry: &FunctionRegistry, ) -> Result<T> { let (expr, _) = ConstantFolder::fold(expr, func_ctx, fn_registry); match expr { Expr::Constant { scalar: Scalar::Number(num), .. } => T::try_downcast_scalar(&num).ok_or_else(|| { ErrorCode::InvalidArgument(format!( "Expect {}, but got {}", T::data_type(), expr.data_type() )) .set_span(span) }), _ => Err(ErrorCode::InvalidArgument(format!( "Expect {}, but got {}", T::data_type(), expr.data_type() )) .set_span(span)), } } pub fn check_function<Index: ColumnIndex>( span: Span, name: &str, params: &[usize], args: &[Expr<Index>], fn_registry: &FunctionRegistry, ) -> Result<Expr<Index>> { if let Some(original_fn_name) = fn_registry.aliases.get(name) { return check_function(span, original_fn_name, params, args, fn_registry); } let candidates = fn_registry.search_candidates(name, params, args); if candidates.is_empty() && !fn_registry.contains(name) { return Err( ErrorCode::UnknownFunction(format!("function `{name}` does not exist")).set_span(span), ); } let auto_cast_rules = fn_registry.get_auto_cast_rules(name); let mut fail_resaons = Vec::with_capacity(candidates.len()); for (id, func) in &candidates { match try_check_function(args, &func.signature, auto_cast_rules, fn_registry) { Ok((checked_args, return_type, generics)) => { return Ok(Expr::FunctionCall { span, id: id.clone(), function: func.clone(), generics, args: checked_args, return_type, }); } Err(err) => fail_resaons.push(err), } } let mut msg = if params.is_empty() { format!( "no overload satisfies `{name}({})`", args.iter() .map(|arg| arg.data_type().to_string()) .join(", ") ) } else { format!( "no overload satisfies `{name}({})({})`", params.iter().join(", "), args.iter() .map(|arg| arg.data_type().to_string()) .join(", ") ) }; if !candidates.is_empty() { let candidates_sig: Vec<_> = candidates .iter() .map(|(_, func)| func.signature.to_string()) .collect(); let max_len = candidates_sig.iter().map(|s| s.len()).max().unwrap_or(0); let candidates_fail_reason = candidates_sig .into_iter() .zip(fail_resaons) .map(|(sig, err)| format!(" {sig:<max_len$} : {}", err.message())) .join("\n"); write!( &mut msg, "\n\nhas tried possible overloads:\n{}", candidates_fail_reason ) .unwrap(); }; Err(ErrorCode::SemanticError(msg).set_span(span)) } #[derive(Debug)] pub struct Substitution(pub HashMap<usize, DataType>); impl Substitution { pub fn empty() -> Self { Substitution(HashMap::new()) } pub fn equation(idx: usize, ty: DataType) -> Self { let mut subst = Self::empty(); subst.0.insert(idx, ty); subst } pub fn merge(mut self, other: Self, auto_cast_rules: AutoCastRules) -> Result<Self> { for (idx, ty2) in other.0 { if let Some(ty1) = self.0.remove(&idx) { let common_ty = common_super_type(ty2.clone(), ty1.clone(), auto_cast_rules) .ok_or_else(|| { ErrorCode::from_string_no_backtrace(format!( "unable to find a common super type for `{ty1}` and `{ty2}`" )) })?; self.0.insert(idx, common_ty); } else { self.0.insert(idx, ty2); } } Ok(self) } pub fn apply(&self, ty: &DataType) -> Result<DataType> { match ty { DataType::Generic(idx) => self.0.get(idx).cloned().ok_or_else(|| { ErrorCode::from_string_no_backtrace(format!("unbound generic type `T{idx}`")) }), DataType::Nullable(box ty) => Ok(DataType::Nullable(Box::new(self.apply(ty)?))), DataType::Array(box ty) => Ok(DataType::Array(Box::new(self.apply(ty)?))), DataType::Map(box ty) => { let inner_ty = self.apply(ty)?; Ok(DataType::Map(Box::new(inner_ty))) } DataType::Tuple(fields_ty) => { let fields_ty = fields_ty .iter() .map(|field_ty| self.apply(field_ty)) .collect::<Result<_>>()?; Ok(DataType::Tuple(fields_ty)) } ty => Ok(ty.clone()), } } } #[allow(clippy::type_complexity)] pub fn try_check_function<Index: ColumnIndex>( args: &[Expr<Index>], sig: &FunctionSignature, auto_cast_rules: AutoCastRules, fn_registry: &FunctionRegistry, ) -> Result<(Vec<Expr<Index>>, DataType, Vec<DataType>)> { let subst = try_unify_signature( args.iter().map(Expr::data_type), sig.args_type.iter(), auto_cast_rules, )?; let checked_args = args .iter() .zip(&sig.args_type) .map(|(arg, sig_type)| { let sig_type = subst.apply(sig_type)?; let is_try = fn_registry.is_auto_try_cast_rule(arg.data_type(), &sig_type); check_cast(arg.span(), is_try, arg.clone(), &sig_type, fn_registry) }) .collect::<Result<Vec<_>>>()?; let return_type = subst.apply(&sig.return_type)?; assert!(!return_type.has_nested_nullable()); let generics = subst .0 .keys() .cloned() .max() .map(|max_generic_idx| { (0..max_generic_idx + 1) .map(|idx| match subst.0.get(&idx) { Some(ty) => Ok(ty.clone()), None => Err(ErrorCode::from_string_no_backtrace(format!( "unable to resolve generic T{idx}" ))), }) .collect::<Result<Vec<_>>>() }) .unwrap_or_else(|| Ok(vec![]))?; Ok((checked_args, return_type, generics)) } pub fn try_unify_signature( src_tys: impl IntoIterator<Item = &DataType> + ExactSizeIterator, dest_tys: impl IntoIterator<Item = &DataType> + ExactSizeIterator, auto_cast_rules: AutoCastRules, ) -> Result<Substitution> { assert_eq!(src_tys.len(), dest_tys.len()); let substs = src_tys .into_iter() .zip(dest_tys) .map(|(src_ty, dest_ty)| unify(src_ty, dest_ty, auto_cast_rules)) .collect::<Result<Vec<_>>>()?; Ok(substs .into_iter() .try_reduce(|subst1, subst2| subst1.merge(subst2, auto_cast_rules))? .unwrap_or_else(Substitution::empty)) } pub fn unify( src_ty: &DataType, dest_ty: &DataType, auto_cast_rules: AutoCastRules, ) -> Result<Substitution> { match (src_ty, dest_ty) { (DataType::Generic(_), _) => Err(ErrorCode::from_string_no_backtrace( "source type {src_ty} must not contain generic type".to_string(), )), (ty, DataType::Generic(_)) if ty.has_generic() => Err(ErrorCode::from_string_no_backtrace( "source type {src_ty} must not contain generic type".to_string(), )), (ty, DataType::Generic(idx)) => Ok(Substitution::equation(*idx, ty.clone())), (src_ty, dest_ty) if can_auto_cast_to(src_ty, dest_ty, auto_cast_rules) => { Ok(Substitution::empty()) } (DataType::Null, DataType::Nullable(_)) => Ok(Substitution::empty()), (DataType::EmptyArray, DataType::Array(_)) => Ok(Substitution::empty()), (DataType::EmptyMap, DataType::Map(_)) => Ok(Substitution::empty()), (DataType::Nullable(src_ty), DataType::Nullable(dest_ty)) => { unify(src_ty, dest_ty, auto_cast_rules) } (src_ty, DataType::Nullable(dest_ty)) => unify(src_ty, dest_ty, auto_cast_rules), (DataType::Array(src_ty), DataType::Array(dest_ty)) => { unify(src_ty, dest_ty, auto_cast_rules) } (DataType::Map(box src_ty), DataType::Map(box dest_ty)) => match (src_ty, dest_ty) { (DataType::Tuple(_), DataType::Tuple(_)) => unify(src_ty, dest_ty, auto_cast_rules), (_, _) => unreachable!(), }, (DataType::Tuple(src_tys), DataType::Tuple(dest_tys)) if src_tys.len() == dest_tys.len() => { let substs = src_tys .iter() .zip(dest_tys) .map(|(src_ty, dest_ty)| unify(src_ty, dest_ty, auto_cast_rules)) .collect::<Result<Vec<_>>>()?; let subst = substs .into_iter() .try_reduce(|subst1, subst2| subst1.merge(subst2, auto_cast_rules))? .unwrap_or_else(Substitution::empty); Ok(subst) } _ => Err(ErrorCode::from_string_no_backtrace(format!( "unable to unify `{}` with `{}`", src_ty, dest_ty ))), } } pub fn can_auto_cast_to( src_ty: &DataType, dest_ty: &DataType, auto_cast_rules: AutoCastRules, ) -> bool { match (src_ty, dest_ty) { (src_ty, dest_ty) if src_ty == dest_ty => true, (src_ty, dest_ty) if auto_cast_rules .iter() .any(|(src, dest)| src == src_ty && dest == dest_ty) => { true } (DataType::Null, DataType::Nullable(_)) => true, (DataType::EmptyArray, DataType::Array(_)) => true, (DataType::EmptyMap, DataType::Map(_)) => true, (DataType::Nullable(src_ty), DataType::Nullable(dest_ty)) => { can_auto_cast_to(src_ty, dest_ty, auto_cast_rules) } (src_ty, DataType::Nullable(dest_ty)) => can_auto_cast_to(src_ty, dest_ty, auto_cast_rules), (DataType::Array(src_ty), DataType::Array(dest_ty)) => { can_auto_cast_to(src_ty, dest_ty, auto_cast_rules) } (DataType::Map(box src_ty), DataType::Map(box dest_ty)) => match (src_ty, dest_ty) { (DataType::Tuple(_), DataType::Tuple(_)) => { can_auto_cast_to(src_ty, dest_ty, auto_cast_rules) } (_, _) => unreachable!(), }, (DataType::Tuple(src_tys), DataType::Tuple(dest_tys)) if src_tys.len() == dest_tys.len() => { src_tys .iter() .zip(dest_tys) .all(|(src_ty, dest_ty)| can_auto_cast_to(src_ty, dest_ty, auto_cast_rules)) } (DataType::String, DataType::Decimal(_)) => true, (DataType::Decimal(x), DataType::Decimal(y)) => x.precision() <= y.precision(), (DataType::Number(n), DataType::Decimal(_)) if !n.is_float() => true, (DataType::Decimal(_), DataType::Number(n)) if n.is_float() => true, _ => false, } } pub fn common_super_type( ty1: DataType, ty2: DataType, auto_cast_rules: AutoCastRules, ) -> Option<DataType> { match (ty1, ty2) { (ty1, ty2) if can_auto_cast_to(&ty1, &ty2, auto_cast_rules) => Some(ty2), (ty1, ty2) if can_auto_cast_to(&ty2, &ty1, auto_cast_rules) => Some(ty1), (DataType::Null, ty @ DataType::Nullable(_)) | (ty @ DataType::Nullable(_), DataType::Null) => Some(ty), (DataType::Null, ty) | (ty, DataType::Null) => Some(DataType::Nullable(Box::new(ty))), (DataType::Nullable(box ty1), DataType::Nullable(box ty2)) | (DataType::Nullable(box ty1), ty2) | (ty1, DataType::Nullable(box ty2)) => Some(DataType::Nullable(Box::new( common_super_type(ty1, ty2, auto_cast_rules)?, ))), (DataType::EmptyArray, ty @ DataType::Array(_)) | (ty @ DataType::Array(_), DataType::EmptyArray) => Some(ty), (DataType::Array(box ty1), DataType::Array(box ty2)) => Some(DataType::Array(Box::new( common_super_type(ty1, ty2, auto_cast_rules)?, ))), (DataType::EmptyMap, ty @ DataType::Map(_)) | (ty @ DataType::Map(_), DataType::EmptyMap) => Some(ty), (DataType::Map(box ty1), DataType::Map(box ty2)) => Some(DataType::Map(Box::new( common_super_type(ty1, ty2, auto_cast_rules)?, ))), (DataType::Tuple(tys1), DataType::Tuple(tys2)) if tys1.len() == tys2.len() => { let tys = tys1 .into_iter() .zip(tys2) .map(|(ty1, ty2)| common_super_type(ty1, ty2, auto_cast_rules)) .collect::<Option<Vec<_>>>()?; Some(DataType::Tuple(tys)) } (DataType::String, decimal_ty @ DataType::Decimal(_)) | (decimal_ty @ DataType::Decimal(_), DataType::String) => Some(decimal_ty), (DataType::Decimal(a), DataType::Decimal(b)) => { let ty = DecimalDataType::binary_result_type(&a, &b, false, false, true).ok(); ty.map(DataType::Decimal) } (DataType::Number(num_ty), DataType::Decimal(decimal_ty)) | (DataType::Decimal(decimal_ty), DataType::Number(num_ty)) if !num_ty.is_float() => { let max_precision = decimal_ty.max_precision(); let scale = decimal_ty.scale(); DecimalDataType::from_size(DecimalSize { precision: max_precision, scale, }) .ok() .map(DataType::Decimal) } (DataType::Number(num_ty), DataType::Decimal(_)) | (DataType::Decimal(_), DataType::Number(num_ty)) if num_ty.is_float() => { Some(DataType::Number(num_ty)) } (ty1, ty2) => { let ty1_can_cast_to = auto_cast_rules .iter() .filter(|(src, _)| *src == ty1) .map(|(_, dest)| dest) .collect::<Vec<_>>(); let ty2_can_cast_to = auto_cast_rules .iter() .filter(|(src, _)| *src == ty2) .map(|(_, dest)| dest) .collect::<Vec<_>>(); ty1_can_cast_to .into_iter() .find(|ty| ty2_can_cast_to.contains(ty)) .cloned() } } } pub fn get_simple_cast_function(is_try: bool, dest_type: &DataType) -> Option<String> { let function_name = if dest_type.is_decimal() { "to_decimal".to_owned() } else { format!("to_{}", dest_type.to_string().to_lowercase()) }; if is_simple_cast_function(&function_name) { let prefix = if is_try { "try_" } else { "" }; Some(format!("{prefix}{function_name}")) } else { None } } pub const ALL_SIMPLE_CAST_FUNCTIONS: &[&str] = &[ "to_string", "to_uint8", "to_uint16", "to_uint32", "to_uint64", "to_int8", "to_int16", "to_int32", "to_int64", "to_float32", "to_float64", "to_timestamp", "to_date", "to_variant", "to_boolean", "to_decimal", ]; pub fn is_simple_cast_function(name: &str) -> bool { ALL_SIMPLE_CAST_FUNCTIONS.contains(&name) }
use super::player_input; use super::VisibilitySystem; //this is possible because i use visiblity_system::* in main.rs use super::{draw_tile_vector, TileType}; use super::{Position, Renderable}; use rltk::{GameState, Rltk}; use specs::prelude::*; pub struct State { pub ecs: World, } impl GameState for State { fn tick(&mut self, ctx: &mut Rltk) { ctx.cls(); player_input(self, ctx); let map = self.ecs.fetch::<Vec<TileType>>(); draw_tile_vector(&map, ctx); let positions = self.ecs.read_storage::<Position>(); let renderables = self.ecs.read_storage::<Renderable>(); for (pos, render) in (&positions, &renderables).join() { ctx.set(pos.x, pos.y, render.fg, render.bg, render.glyph); } } } impl State { fn run_systems(&mut self) { let mut vis = VisibilitySystem {}; vis.run_now(&self.ecs); self.ecs.maintain(); } }
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //use core::mem; //use alloc::sync::Arc; //use spin::Mutex; //use super::super::super::SignalDef::*; //use super::super::super::stack::*; //use super::super::super::qlib::common::*; //use super::super::super::qlib::linux_def::*; use super::context::*; //use super::arch_x86::*; const FP_XSTATE_MAGIC2_SIZE: usize = 4; impl Context64 { fn fpuFrameSize(&self) -> (u64, bool) { let mut size = self.state.x86FPState.lock().size; let mut useXsave = false; if size > 512 { // Make room for the magic cookie at the end of the xsave frame. size += FP_XSTATE_MAGIC2_SIZE; useXsave = true; } return (size as u64, useXsave) } // SignalSetup implements Context.SignalSetup. (Compare to Linux's // arch/x86/kernel/signal.c:__setup_rt_frame().) /*pub fn SignalSetup(&mut self, st: &mut Stack, act: &SigAct, info: &mut SignalInfo, alt: &SignalStack, sigset: SignalSet) -> Result<()> { let mut sp = st.sp; // "The 128-byte area beyond the location pointed to by %rsp is considered // to be reserved and shall not be modified by signal or interrupt // handlers. ... leaf functions may use this area for their entire stack // frame, rather than adjusting the stack pointer in the prologue and // epilogue." - AMD64 ABI // // (But this doesn't apply if we're starting at the top of the signal // stack, in which case there is no following stack frame.) if !(alt.IsEnable() && sp == alt.Top()) { sp -= 128; } let (fpSize, _) = self.fpuFrameSize(); sp = (sp - fpSize) & !(64 - 1); let regs = &self.state.Regs; // Construct the UContext64 now since we need its size. let mut uc = UContext { // No _UC_FP_XSTATE: see Fpstate above. // No _UC_STRICT_RESTORE_SS: we don't allow SS changes. Flags: UC_SIGCONTEXT_SS, Link: 0, Stack: *alt, MContext: SigContext::New(regs, sigset.0, 0, 0), Sigset: sigset.0, }; // based on the fault that caused the signal. For now, leave Err and // Trapno unset and assume CR2 == info.Addr() for SIGSEGVs and // SIGBUSes. if info.Signo == Signal::SIGSEGV || info.Signo == Signal::SIGBUS { uc.MContext.cr2 = info.SigFault().addr; } // "... the value (%rsp+8) is always a multiple of 16 (...) when // control is transferred to the function entry point." - AMD64 ABI let ucSize = mem::size_of::<UContext>(); let frameSize = 8 + ucSize + 128; let frameBottom = (sp - frameSize as u64) & !15 - 8; sp = frameBottom + frameSize as u64; st.sp = sp; // Prior to proceeding, figure out if the frame will exhaust the range // for the signal stack. This is not allowed, and should immediately // force signal delivery (reverting to the default handler). if act.flags.IsOnStack() && alt.IsEnable() && !alt.Contains(frameBottom) { return Err(Error::SysError(SysErr::EFAULT)) } // Adjust the code. info.FixSignalCodeForUser(); let infoAddr = st.PushType::<SignalInfo>(info); let ucAddr = st.PushType::<UContext>(&uc); if act.flags.HasRestorer() { st.PushU64(act.restorer); } else { return Err(Error::SysError(SysErr::EFAULT)) } self.state.Regs.rip = act.handler; self.state.Regs.rsp = st.sp; self.state.Regs.rdi = info.Signo as u64; self.state.Regs.rsi = infoAddr; self.state.Regs.rdx = ucAddr; self.state.Regs.rax = 0; // Save the thread's floating point state. self.sigFPState.push(self.state.x86FPState.clone()); self.state.x86FPState = Arc::new(Mutex::new(X86fpstate::NewX86FPState())); return Ok(()) }*/ }
use clap::Parser; use orfail::OrFail; use rofis::{ dirs_index::DirsIndex, http::{HttpMethod, HttpRequest, HttpResponse, HttpResponseBody}, }; use std::{ net::{TcpListener, TcpStream}, path::{Path, PathBuf}, time::{Duration, SystemTime}, }; /// Read-only HTTP file server. #[derive(Debug, Parser)] #[clap(version)] struct Args { /// Listen port number. #[clap(short, long, default_value_t = 8080)] port: u16, /// Root directory [default: $PWD]. #[clap(short, long)] root_dir: Option<PathBuf>, /// Log level (DEBUG | INFO | WARN | ERROR).. #[clap(short, long, default_value_t = log::LevelFilter::Info)] log_level: log::LevelFilter, /// Daemonize HTTP server. #[clap(short, long)] daemonize: bool, } fn main() -> orfail::Result<()> { let args = Args::parse(); env_logger::builder() .filter_level(args.log_level) .try_init() .or_fail()?; if args.daemonize { daemonize::Daemonize::new() .working_directory(std::env::current_dir().or_fail()?) .start() .or_fail()?; } let root_dir = args .root_dir .clone() .unwrap_or(std::env::current_dir().or_fail()?); log::info!("Starts building directories index: root_dir={root_dir:?}"); let mut dirs_index = DirsIndex::build(&root_dir).or_fail()?; log::info!( "Finished building directories index: entries={}", dirs_index.len() ); let listener = TcpListener::bind(("127.0.0.1", args.port)).or_fail()?; log::info!("Started HTTP server on {} port", args.port); for socket in listener.incoming() { let mut socket = match socket.or_fail() { Ok(socket) => socket, Err(e) => { let e: orfail::Failure = e; log::warn!("Failed to accept socket: {e}"); continue; } }; log::debug!("Accepted a client socket: {socket:?}"); let response = match HttpRequest::from_reader(&mut socket).or_fail() { Ok(Ok(request)) => { log::info!("Read: {request:?}"); let result = resolve_path(&dirs_index, &request).or_else(|response| { if response.is_not_found() { // The directories index may be outdated. log::info!( "Starts re-building directories index: root_dir={:?}", dirs_index.root_dir() ); match DirsIndex::build(dirs_index.root_dir()).or_fail() { Ok(new_dirs_index) => { dirs_index = new_dirs_index; log::info!( "Finished re-building directories index: entries={}", dirs_index.len() ); resolve_path(&dirs_index, &request) } Err(e) => { let e: orfail::Failure = e; log::warn!("Failed to re-build directories index: {e}"); Err(response) } } } else { Err(response) } }); match result { Err(response) => response, Ok(resolved_path) => match request.method() { HttpMethod::Head => head_file(resolved_path), HttpMethod::Get => get_file(resolved_path), HttpMethod::Watch => { watch_file(resolved_path, socket); continue; } }, } } Ok(Err(response)) => response, Err(e) => { let e: orfail::Failure = e; log::warn!("Failed to read HTTP request: {e}"); continue; } }; write_response(socket, response); } Ok(()) } fn resolve_path(dirs_index: &DirsIndex, request: &HttpRequest) -> Result<PathBuf, HttpResponse> { let path = request.path(); let (dir, name) = if path.ends_with('/') { (path, "index.html") } else { let mut iter = path.rsplitn(2, '/'); let Some(name) = iter.next() else { return Err(HttpResponse::bad_request()); }; let Some(dir) = iter.next() else { return Err(HttpResponse::bad_request()); }; (dir, name) }; let candidates = dirs_index .find_dirs_by_suffix(dir.trim_matches('/')) .into_iter() .map(|dir| dir.join(name)) .filter(|path| path.is_file()) .collect::<Vec<_>>(); if candidates.is_empty() { return Err(HttpResponse::not_found()); } else if candidates.len() > 1 { return Err(HttpResponse::multiple_choices(candidates.len())); } Ok(candidates[0].clone()) } fn get_file<P: AsRef<Path>>(path: P) -> HttpResponse { let Ok(content) = std::fs::read(&path) else { return HttpResponse::internal_server_error(); }; let mime = mime_guess::from_path(path).first_or_octet_stream(); let body = HttpResponseBody::Content(content); HttpResponse::ok(mime, body) } fn head_file<P: AsRef<Path>>(path: P) -> HttpResponse { let Ok(content) = std::fs::read(&path) else { return HttpResponse::internal_server_error(); }; let mime = mime_guess::from_path(path).first_or_octet_stream(); let body = HttpResponseBody::Length(content.len()); HttpResponse::ok(mime, body) } fn watch_file(path: PathBuf, socket: TcpStream) { let Some(mtime) = get_mtime(&path) else { write_response(socket, HttpResponse::internal_server_error()); return; }; log::info!("Starts watching: path={path:?}, mtime={mtime:?}"); std::thread::spawn(move || loop { std::thread::sleep(Duration::from_millis(100)); let latest_mtime = get_mtime(&path); if latest_mtime != Some(mtime) { log::info!("Stopped watching: path={path:?}, mtime={latest_mtime:?}"); let response = get_file(path); write_response(socket, response); return; } }); } fn get_mtime<P: AsRef<Path>>(path: P) -> Option<SystemTime> { path.as_ref().metadata().ok()?.modified().ok() } fn write_response(mut socket: TcpStream, response: HttpResponse) { if let Err(e) = response.to_writer(&mut socket) { log::warn!("Failed to write HTTP response: {e}"); } else { log::info!("Wrote: {response:?}"); } }
use crate::errors::ServiceError; use crate::models::device::{Device as Object, GetList, GetWithShop, GetWithShopRes, New, Update}; use crate::models::msg::Msg; use crate::models::DbExecutor; use crate::schema::user_device::dsl::{id, name, sw_token, user_device as tb, user_id}; use actix::Handler; use diesel; use diesel::prelude::*; use serde_json::json; use diesel::sql_query; use diesel::sql_types::{Text, Uuid}; impl Handler<New> for DbExecutor { type Result = Result<Msg, ServiceError>; fn handle(&mut self, msg: New, _: &mut Self::Context) -> Self::Result { let conn = &self.0.get()?; let check = tb .filter(&name.eq(&msg.name)) .filter(&sw_token.eq(&msg.sw_token)) .load::<Object>(conn)? .pop(); match check { Some(_) => Err(ServiceError::BadRequest("중복".into())), None => { let insert: Object = diesel::insert_into(tb) .values(&msg) .get_result::<Object>(conn)?; let payload = serde_json::json!({ "item": insert, }); Ok(Msg { status: 200, data: payload, }) } } } } impl Handler<GetWithShop> for DbExecutor { type Result = Result<GetWithShopRes, ServiceError>; fn handle(&mut self, msg: GetWithShop, _: &mut Self::Context) -> Self::Result { let conn = &self.0.get()?; let q = sql_query( " SELECT a.shop_id, a.notification_key, a.device_cnt, CASE WHEN length(a.notification_key) > 0 THEN case when a.device_cnt > 0 then 'pass' else 'add' end WHEN length(a.notification_key) = 0 THEN 'create' ELSE '' END AS operation FROM (SELECT s.id AS shop_id, s.notification_key AS notification_key, Count(d.id) AS device_cnt FROM shop s LEFT JOIN user_device d ON s.ceo_id = d.user_id AND d.sw_token = $2 WHERE s.ceo_id = $1 GROUP BY s.id) a ", ) .bind::<Uuid, _>(&msg.user_id) .bind::<Text, _>(&msg.sw_token); let res = q.get_result::<GetWithShopRes>(conn).expect(" 쿼리오류 "); Ok(res) } } impl Handler<GetList> for DbExecutor { type Result = Result<Msg, ServiceError>; fn handle(&mut self, msg: GetList, _: &mut Self::Context) -> Self::Result { let conn = &self.0.get()?; let items = tb.filter(&user_id.eq(&msg.user_id)).load::<Object>(conn)?; let payload = json!({ "items": items, }); Ok(Msg { status: 200, data: payload, }) } } impl Handler<Update> for DbExecutor { type Result = Result<Msg, ServiceError>; fn handle(&mut self, msg: Update, _: &mut Self::Context) -> Self::Result { let conn = &self.0.get()?; let check = tb.filter(&id.eq(&msg.id)).load::<Object>(conn)?.pop(); match check { Some(_) => Err(ServiceError::BadRequest( "이미 있는 이름입니다.".into(), )), None => { let old_item = tb.filter(&id.eq(&msg.id)).get_result::<Object>(conn)?; let item_update = diesel::update(&old_item) .set(&msg) .get_result::<Object>(conn)?; let payload = serde_json::json!({ "item": item_update, }); Ok(Msg { status: 200, data: payload, }) } } } }
extern crate std; use std::net::{Ipv4Addr,Ipv6Addr,SocketAddr,IpAddr}; use uuid::Uuid; use std::borrow::Cow; use std::ops::Deref; use std::error::Error; use def::CowStr; #[derive(Debug,Clone)] pub enum RCErrorType { ReadError, WriteError, SerializeError, ConnectionError, NoDataError, GenericError, IOError, EventLoopError, ClusterError } #[derive(Debug,Clone)] pub struct RCError { pub kind: RCErrorType, pub desc: CowStr, } impl RCError { pub fn new<S: Into<CowStr>>(msg: S, kind: RCErrorType) -> RCError { RCError { kind: kind, desc: msg.into() } } pub fn description(&self) -> &str { return self.desc.deref(); } } impl std::error::Error for RCError { fn description(&self) -> &str { return self.desc.deref(); } fn cause(&self) -> Option<&std::error::Error> { return None; } } impl std::fmt::Display for RCError { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { write!(f, "Error: {}", self.desc) } } pub type RCResult<T> = Result<T, RCError>;
fn print(s: &str) { eprintln!("{}", s); } fn main() { // When to use String and when to use sting slice (&str) // * String when you have to modify it // * &str when you don't // Owned let mut my_string: String = String::new(); // Wrapper around Vec<u8> my_string.push_str("hello world"); my_string.push_str("hello world again"); // Borrow let s: &str = "This is a string Literal"; eprintln!("{}", my_string); eprintln!("{}", s.trim()); print(&my_string); print(&my_string); let bunny = "1fdasfy".to_string(); eprintln!("len: {:?}", bunny.len()); }
pub mod exchanges; use net_client; use ex_api; pub trait Api { fn current_price<E>(&self, net: &mut net_client::Client, api: &E, coin: &str) -> f64 where E: ex_api::exchanges::Exchange; } pub struct ApiCall {} impl ApiCall { pub fn new() -> ApiCall { ApiCall {} } } impl Api for ApiCall { fn current_price<E>(&self, net: &mut net_client::Client, api: &E, coin: &str) -> f64 where E: ex_api::exchanges::Exchange { net.get(&api.current_price_uri(coin)); 0.3 } }
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. ///! Serves Client policy services. ///! Note: This implementation is still under development. ///! Only connect requests will cause the underlying SME to attempt to connect to a given ///! network. ///! Unfortunately, there is currently no way to send an Epitaph in Rust. Thus, inbound ///! controller and listener requests are simply dropped, causing the underlying channel to ///! get closed. ///! use { crate::{fuse_pending::FusePending, known_ess_store::KnownEssStore}, failure::{format_err, Error}, fidl::epitaph::ChannelEpitaphExt, fidl_fuchsia_wlan_common as fidl_common, fidl_fuchsia_wlan_policy as fidl_policy, fidl_fuchsia_wlan_sme as fidl_sme, fuchsia_async as fasync, fuchsia_zircon as zx, futures::{ channel::mpsc, prelude::*, select, stream::{FuturesOrdered, FuturesUnordered}, }, log::{error, info}, parking_lot::Mutex, std::sync::Arc, }; pub mod listener; /// Wrapper around a Client interface, granting access to the Client SME. /// A Client might not always be available, for example, if no Client interface was created yet. pub struct Client { proxy: Option<fidl_sme::ClientSmeProxy>, } impl Client { /// Creates a new, empty Client. The returned Client effectively represents the state in which /// no client interface is available. pub fn new_empty() -> Self { Self { proxy: None } } /// Accesses the Client interface's SME. /// Returns None if no Client interface is available. fn access_sme(&self) -> Option<&fidl_sme::ClientSmeProxy> { self.proxy.as_ref() } } impl From<fidl_sme::ClientSmeProxy> for Client { fn from(proxy: fidl_sme::ClientSmeProxy) -> Self { Self { proxy: Some(proxy) } } } #[derive(Debug)] struct RequestError { cause: Error, status: fidl_common::RequestStatus, } impl RequestError { /// Produces a new `RequestError` for internal errors. fn new() -> Self { RequestError { cause: format_err!("internal error"), status: fidl_common::RequestStatus::RejectedNotSupported, } } fn with_cause(self, cause: Error) -> Self { RequestError { cause, ..self } } fn with_status(self, status: fidl_common::RequestStatus) -> Self { RequestError { status, ..self } } } impl From<fidl::Error> for RequestError { fn from(e: fidl::Error) -> RequestError { RequestError::new() .with_cause(format_err!("FIDL error: {}", e)) .with_status(fidl_common::RequestStatus::RejectedNotSupported) } } #[derive(Debug)] enum InternalMsg { /// Sent when a new connection request was issued. Holds the NetworkIdentifier and the /// Transaction which will the connection result will be reported through. NewPendingConnectRequest(fidl_policy::NetworkIdentifier, fidl_sme::ConnectTransactionProxy), } type InternalMsgSink = mpsc::UnboundedSender<InternalMsg>; // This number was chosen arbitrarily. const MAX_CONCURRENT_LISTENERS: usize = 1000; const PSK_HEX_STRING_LENGTH: usize = 64; type ClientRequests = fidl::endpoints::ServerEnd<fidl_policy::ClientControllerMarker>; type EssStorePtr = Arc<KnownEssStore>; type ClientPtr = Arc<Mutex<Client>>; pub fn spawn_provider_server( client: ClientPtr, update_sender: listener::MessageSender, ess_store: EssStorePtr, requests: fidl_policy::ClientProviderRequestStream, ) { fasync::spawn(serve_provider_requests(client, update_sender, ess_store, requests)); } pub fn spawn_listener_server( update_sender: listener::MessageSender, requests: fidl_policy::ClientListenerRequestStream, ) { fasync::spawn(serve_listener_requests(update_sender, requests)); } /// Serves the ClientProvider protocol. /// Only one ClientController can be active. Additional requests to register ClientControllers /// will result in their channel being immediately closed. async fn serve_provider_requests( client: ClientPtr, update_sender: listener::MessageSender, ess_store: EssStorePtr, mut requests: fidl_policy::ClientProviderRequestStream, ) { let (internal_messages_sink, mut internal_messages_stream) = mpsc::unbounded(); let mut controller_reqs = FuturesUnordered::new(); let mut pending_con_reqs = FusePending(FuturesOrdered::new()); loop { select! { // Progress controller requests. _ = controller_reqs.select_next_some() => (), // Process provider requests. req = requests.select_next_some() => if let Ok(req) = req { // If there is an active controller - reject new requests. // Rust cannot yet send Epitaphs when closing a channel, thus, simply drop the // request. if controller_reqs.is_empty() { let fut = handle_provider_request( Arc::clone(&client), internal_messages_sink.clone(), update_sender.clone(), Arc::clone(&ess_store), req ); controller_reqs.push(fut); } else { if let Err(e) = reject_provider_request(req) { error!("error sending rejection epitaph"); } } }, // Progress internal messages. msg = internal_messages_stream.select_next_some() => match msg { InternalMsg::NewPendingConnectRequest(id, txn) => { let connect_result_fut = txn.take_event_stream().into_future() .map(|(first, _next)| (id, first)); pending_con_reqs.push(connect_result_fut); } }, // Pending connect request finished. resp = pending_con_reqs.select_next_some() => if let (id, Some(Ok(txn))) = resp { handle_sme_connect_response(update_sender.clone(), id, txn).await; } } } } /// Serves the ClientListener protocol. async fn serve_listener_requests( update_sender: listener::MessageSender, requests: fidl_policy::ClientListenerRequestStream, ) { let serve_fut = requests .try_for_each_concurrent(MAX_CONCURRENT_LISTENERS, |req| { handle_listener_request(update_sender.clone(), req) }) .unwrap_or_else(|e| error!("error serving Client Listener API: {}", e)); let _ignored = serve_fut.await; } /// Handle inbound requests to acquire a new ClientController. async fn handle_provider_request( client: ClientPtr, internal_msg_sink: InternalMsgSink, update_sender: listener::MessageSender, ess_store: EssStorePtr, req: fidl_policy::ClientProviderRequest, ) -> Result<(), fidl::Error> { match req { fidl_policy::ClientProviderRequest::GetController { requests, updates, .. } => { register_listener(update_sender, updates.into_proxy()?); handle_client_requests(client, internal_msg_sink, ess_store, requests).await?; Ok(()) } } } /// Handles all incoming requests from a ClientController. async fn handle_client_requests( client: ClientPtr, internal_msg_sink: InternalMsgSink, ess_store: EssStorePtr, requests: ClientRequests, ) -> Result<(), fidl::Error> { let mut request_stream = requests.into_stream()?; while let Some(request) = request_stream.try_next().await? { match request { fidl_policy::ClientControllerRequest::Connect { id, responder, .. } => { match handle_client_request_connect( Arc::clone(&client), Arc::clone(&ess_store), &id, ) .await { Ok(txn) => { responder.send(fidl_common::RequestStatus::Acknowledged)?; // TODO(hahnr): Send connecting update. let _ignored = internal_msg_sink .unbounded_send(InternalMsg::NewPendingConnectRequest(id, txn)); } Err(error) => { error!("error while connection attempt: {}", error.cause); responder.send(error.status)?; } } } unsupported => error!("unsupported request: {:?}", unsupported), } } Ok(()) } async fn handle_sme_connect_response( update_sender: listener::MessageSender, id: fidl_policy::NetworkIdentifier, txn_event: fidl_sme::ConnectTransactionEvent, ) { match txn_event { fidl_sme::ConnectTransactionEvent::OnFinished { code } => match code { fidl_sme::ConnectResultCode::Success => { info!("connection request successful to: {:?}", id); let update = fidl_policy::ClientStateSummary { state: None, networks: Some(vec![fidl_policy::NetworkState { id: Some(id), state: Some(fidl_policy::ConnectionState::Connected), status: None, }]), }; let _ignored = update_sender.unbounded_send(listener::Message::NotifyListeners(update)); } // No-op. Connect request was replaced. fidl_sme::ConnectResultCode::Canceled => (), error_code => { error!("connection request failed to: {:?} - {:?}", id, error_code); // TODO(hahnr): Send failure update. } }, } } /// Attempts to issue a new connect request to the currently active Client. /// The network's configuration must have been stored before issuing a connect request. async fn handle_client_request_connect( client: ClientPtr, ess_store: EssStorePtr, network: &fidl_policy::NetworkIdentifier, ) -> Result<fidl_sme::ConnectTransactionProxy, RequestError> { let network_config = ess_store.lookup(&network.ssid[..]).ok_or_else(|| { RequestError::new().with_cause(format_err!( "error network not found: {}", String::from_utf8_lossy(&network.ssid) )) })?; // TODO(hahnr): Discuss whether every request should verify the existence of a Client, or // whether that should be handled by either, closing the currently active controller if a // client interface is brought down and not supporting controller requests if no client // interface is active. let client = client.lock(); let client_sme = client.access_sme().ok_or_else(|| { RequestError::new().with_cause(format_err!("error no active client interface")) })?; // TODO(hahnr): The credential type from the given NetworkIdentifier is currently ignored. // Instead the credentials are derived from the saved |network_config| which is looked-up. // There has to be a decision how the case of two different credential types should be handled. let credential = credential_from_bytes(network_config.password); let mut request = fidl_sme::ConnectRequest { ssid: network.ssid.to_vec(), credential, radio_cfg: fidl_sme::RadioConfig { override_phy: false, phy: fidl_common::Phy::Vht, override_cbw: false, cbw: fidl_common::Cbw::Cbw80, override_primary_chan: false, primary_chan: 0, }, scan_type: fidl_common::ScanType::Passive, }; let (local, remote) = fidl::endpoints::create_proxy()?; client_sme.connect(&mut request, Some(remote))?; Ok(local) } /// Handle inbound requests to register an additional ClientStateUpdates listener. async fn handle_listener_request( update_sender: listener::MessageSender, req: fidl_policy::ClientListenerRequest, ) -> Result<(), fidl::Error> { match req { fidl_policy::ClientListenerRequest::GetListener { updates, .. } => { register_listener(update_sender, updates.into_proxy()?); Ok(()) } } } /// Registers a new update listener. /// The client's current state will be send to the newly added listener immediately. fn register_listener( update_sender: listener::MessageSender, listener: fidl_policy::ClientStateUpdatesProxy, ) { let _ignored = update_sender.unbounded_send(listener::Message::NewListener(listener)); } /// Returns: /// - an Open-Credential instance iff `bytes` is empty, /// - a PSK-Credential instance iff `bytes` holds exactly 64 bytes, /// - a Password-Credential in all other cases. /// In the PSK case, the provided bytes must represent the PSK in hex format. /// Note: This function is of temporary nature until Wlancfg's ESS-Store supports richer /// credential types beyond plain passwords. fn credential_from_bytes(bytes: Vec<u8>) -> fidl_sme::Credential { match bytes.len() { 0 => fidl_sme::Credential::None(fidl_sme::Empty), PSK_HEX_STRING_LENGTH => fidl_sme::Credential::Psk(bytes), _ => fidl_sme::Credential::Password(bytes), } } /// Rejects a ClientProvider request by sending a corresponding Epitaph via the |requests| and /// |updates| channels. fn reject_provider_request(req: fidl_policy::ClientProviderRequest) -> Result<(), fidl::Error> { match req { fidl_policy::ClientProviderRequest::GetController { requests, updates, .. } => { requests.into_channel().close_with_epitaph(zx::Status::ALREADY_BOUND)?; updates.into_channel().close_with_epitaph(zx::Status::ALREADY_BOUND)?; Ok(()) } } } #[cfg(test)] mod tests { use { super::*, crate::known_ess_store::KnownEss, fidl::{ endpoints::{create_proxy, create_request_stream}, Error, }, futures::{channel::mpsc, task::Poll}, pin_utils::pin_mut, std::path::Path, wlan_common::assert_variant, }; /// Creates an ESS Store holding entries for protected and unprotected networks. fn create_ess_store(path: &Path) -> EssStorePtr { let ess_store = Arc::new( KnownEssStore::new_with_paths(path.join("store.json"), path.join("store.json.tmp")) .expect("Failed to create a KnownEssStore"), ); ess_store .store(b"foobar".to_vec(), KnownEss { password: vec![] }) .expect("error saving network"); ess_store .store(b"foobar-protected".to_vec(), KnownEss { password: b"supersecure".to_vec() }) .expect("error saving network"); ess_store } /// Requests a new ClientController from the given ClientProvider. fn request_controller( provider: &fidl_policy::ClientProviderProxy, ) -> (fidl_policy::ClientControllerProxy, fidl_policy::ClientStateUpdatesRequestStream) { let (controller, requests) = create_proxy::<fidl_policy::ClientControllerMarker>() .expect("failed to create ClientController proxy"); let (update_sink, update_stream) = create_request_stream::<fidl_policy::ClientStateUpdatesMarker>() .expect("failed to create ClientStateUpdates proxy"); provider.get_controller(requests, update_sink).expect("error getting controller"); (controller, update_stream) } /// Creates a Client wrapper. fn create_client() -> (ClientPtr, fidl_sme::ClientSmeRequestStream) { let (client_sme, remote) = create_proxy::<fidl_sme::ClientSmeMarker>().expect("error creating proxy"); ( Arc::new(Mutex::new(client_sme.into())), remote.into_stream().expect("failed to create stream"), ) } #[test] fn connect_request_unknown_network() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, _sme_stream) = create_client(); let (update_sender, _listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (controller, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar-unknown".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request and verify connect response. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::RejectedNotSupported)) ); } #[test] fn connect_request_open_network() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, mut sme_stream) = create_client(); let (update_sender, _listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (controller, _update_stream) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request and verify connect response. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::Acknowledged)) ); assert_variant!( exec.run_until_stalled(&mut sme_stream.next()), Poll::Ready(Some(Ok(fidl_sme::ClientSmeRequest::Connect { req, .. }))) => { assert_eq!(b"foobar", &req.ssid[..]); assert_eq!(fidl_sme::Credential::None(fidl_sme::Empty), req.credential); } ); } #[test] fn connect_request_protected_network() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (update_sender, _listener_updates) = mpsc::unbounded(); let (client, mut sme_stream) = create_client(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (controller, _update_stream) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar-protected".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request and verify connect response. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::Acknowledged)) ); assert_variant!( exec.run_until_stalled(&mut sme_stream.next()), Poll::Ready(Some(Ok(fidl_sme::ClientSmeRequest::Connect { req, .. }))) => { assert_eq!(b"foobar-protected", &req.ssid[..]); assert_eq!(fidl_sme::Credential::Password(b"supersecure".to_vec()), req.credential); // TODO(hahnr): Send connection response. } ); } #[test] fn connect_request_success() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, mut sme_stream) = create_client(); let (update_sender, mut listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (controller, _update_stream) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!(exec.run_until_stalled(&mut listener_updates.next()), Poll::Ready(_)); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request and verify connect response. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!(exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(_))); assert_variant!( exec.run_until_stalled(&mut sme_stream.next()), Poll::Ready(Some(Ok(fidl_sme::ClientSmeRequest::Connect { txn, .. }))) => { // Send connection response. let (_stream, ctrl) = txn.expect("connect txn unused") .into_stream_and_control_handle().expect("error accessing control handle"); ctrl.send_on_finished(fidl_sme::ConnectResultCode::Success) .expect("failed to send connection completion"); } ); // Process SME result. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Verify status update. let summary = assert_variant!( exec.run_until_stalled(&mut listener_updates.next()), Poll::Ready(Some(listener::Message::NotifyListeners(summary))) => summary ); let expected_summary = fidl_policy::ClientStateSummary { state: None, networks: Some(vec![fidl_policy::NetworkState { id: Some(fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }), state: Some(fidl_policy::ConnectionState::Connected), status: None, }]), }; assert_eq!(summary, expected_summary); } #[test] fn connect_request_failure() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, mut sme_stream) = create_client(); let (update_sender, mut listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (controller, _update_stream) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!(exec.run_until_stalled(&mut listener_updates.next()), Poll::Ready(_)); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request and verify connect response. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!(exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(_))); assert_variant!( exec.run_until_stalled(&mut sme_stream.next()), Poll::Ready(Some(Ok(fidl_sme::ClientSmeRequest::Connect { txn, .. }))) => { // Send failed connection response. let (_stream, ctrl) = txn.expect("connect txn unused") .into_stream_and_control_handle().expect("error accessing control handle"); ctrl.send_on_finished(fidl_sme::ConnectResultCode::Failed) .expect("failed to send connection completion"); } ); // Process SME result. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Verify status was not updated. assert_variant!(exec.run_until_stalled(&mut listener_updates.next()), Poll::Pending); } #[test] fn register_update_listener() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, _sme_stream) = create_client(); let (update_sender, mut listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a new controller. let (_controller, _update_stream) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut listener_updates.next()), Poll::Ready(Some(listener::Message::NewListener(_))) ); } #[test] fn get_listener() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let (listener, requests) = create_proxy::<fidl_policy::ClientListenerMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (update_sender, mut listener_updates) = mpsc::unbounded(); let serve_fut = serve_listener_requests(update_sender, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Register listener. let (update_sink, _update_stream) = create_request_stream::<fidl_policy::ClientStateUpdatesMarker>() .expect("failed to create ClientStateUpdates proxy"); listener.get_listener(update_sink).expect("error getting listener"); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut listener_updates.next()), Poll::Ready(Some(listener::Message::NewListener(_))) ); } #[test] fn multiple_controllers_write_attempt() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, _sme_stream) = create_client(); let (update_sender, _listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a controller. let (controller1, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request another controller. let (controller2, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Ensure first controller is operable. Issue connect request. let connect_fut = controller1.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request from first controller. Verify success. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::Acknowledged)) ); // Ensure second controller is not operable. Issue connect request. let connect_fut = controller2.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request from second controller. Verify failure. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Err(Error::ClientWrite(zx::Status::PEER_CLOSED))) ); // Drop first controller. A new controller can now take control. drop(controller1); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request another controller. let (controller3, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Ensure third controller is operable. Issue connect request. let connect_fut = controller3.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request from third controller. Verify success. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::Acknowledged)) ); } #[test] fn multiple_controllers_epitaph() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let (client, _sme_stream) = create_client(); let (update_sender, _listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a controller. let (_controller1, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request another controller. let (controller2, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); let chan = controller2.into_channel().expect("error turning proxy into channel"); let mut buffer = zx::MessageBuf::new(); let epitaph_fut = chan.recv_msg(&mut buffer); pin_mut!(epitaph_fut); assert_variant!(exec.run_until_stalled(&mut epitaph_fut), Poll::Ready(Ok(_))); // Verify Epitaph was received. use fidl::encoding::{decode_transaction_header, Decodable, Decoder, EpitaphBody}; let (header, tail) = decode_transaction_header(buffer.bytes()).expect("failed decoding header"); let mut msg = Decodable::new_empty(); Decoder::decode_into::<EpitaphBody>(&header, tail, &mut [], &mut msg) .expect("failed decoding body"); assert_eq!(msg.error, zx::Status::ALREADY_BOUND); assert!(chan.is_closed()); } #[test] fn no_client_interface() { let mut exec = fasync::Executor::new().expect("failed to create an executor"); let temp_dir = tempfile::TempDir::new().expect("failed to create temp dir"); let ess_store = create_ess_store(temp_dir.path()); let (provider, requests) = create_proxy::<fidl_policy::ClientProviderMarker>() .expect("failed to create ClientProvider proxy"); let requests = requests.into_stream().expect("failed to create stream"); let client = Arc::new(Mutex::new(Client::new_empty())); let (update_sender, _listener_updates) = mpsc::unbounded(); let serve_fut = serve_provider_requests(client, update_sender, ess_store, requests); pin_mut!(serve_fut); // No request has been sent yet. Future should be idle. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Request a controller. let (controller, _) = request_controller(&provider); assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); // Issue connect request. let connect_fut = controller.connect(&mut fidl_policy::NetworkIdentifier { ssid: b"foobar".to_vec(), type_: fidl_policy::SecurityType::None, }); pin_mut!(connect_fut); // Process connect request from first controller. Verify success. assert_variant!(exec.run_until_stalled(&mut serve_fut), Poll::Pending); assert_variant!( exec.run_until_stalled(&mut connect_fut), Poll::Ready(Ok(fidl_common::RequestStatus::RejectedNotSupported)) ); } #[test] fn test_credential_from_bytes() { assert_eq!(credential_from_bytes(vec![1]), fidl_sme::Credential::Password(vec![1])); assert_eq!(credential_from_bytes(vec![2; 63]), fidl_sme::Credential::Password(vec![2; 63])); assert_eq!(credential_from_bytes(vec![2; 64]), fidl_sme::Credential::Psk(vec![2; 64])); assert_eq!(credential_from_bytes(vec![]), fidl_sme::Credential::None(fidl_sme::Empty)); } }
use segment::*; use std::net::*; use std::sync::mpsc::*; use std::collections::VecDeque; use std::cmp::*; use std::time::Duration; use utils::*; const WINDOW_SIZE: usize = 65000; const MAX_PAYLOAD_SIZE: usize = 1500; const TIMEOUT: u64 = 1; // In seconds #[derive(Debug, Copy, Clone, PartialEq)] pub enum TCBState { Listen, SynSent, SynRecd, Estab, Closed, } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct TCPTuple { pub src: SocketAddr, pub dst: SocketAddr, } #[derive(Debug)] pub enum TCBInput { SendSyn, Receive(Segment), Send(Vec<u8>), Close, } #[derive(Debug)] pub struct TCB { tuple: TCPTuple, state: TCBState, socket: UdpSocket, data_input: Receiver<TCBInput>, byte_output: Sender<u8>, send_buffer: VecDeque<u8>, // Data to be sent that hasn't been send_window: VecDeque<u8>, recv_window: VecDeque<Option<u8>>, seq_base: u32, ack_base: u32, unacked_segs: VecDeque<Segment>, dupe_acks: u32, } impl TCB { pub fn new(tuple: TCPTuple, udp_sock: UdpSocket) -> (TCB, Sender<TCBInput>, Receiver<u8>) { let (data_input_tx, data_input_rx) = channel(); let (byte_output_tx, byte_output_rx) = channel(); ( TCB { tuple: tuple, state: TCBState::Listen, socket: udp_sock, data_input: data_input_rx, byte_output: byte_output_tx, send_buffer: VecDeque::new(), send_window: VecDeque::new(), recv_window: VecDeque::from(vec![Option::None; WINDOW_SIZE]), seq_base: 1, ack_base: 1, unacked_segs: VecDeque::new(), dupe_acks: 0, }, data_input_tx, byte_output_rx, ) } pub fn recv(out: &Receiver<u8>, amt: u32) -> Result<Vec<u8>, RecvError> { let mut buf = Vec::with_capacity(amt as usize); while buf.len() < amt as usize { buf.push(out.recv()?); } Ok(buf) } pub fn run_tcp(&mut self) { 'event_loop: while self.state != TCBState::Closed { self.handle_input_recv(); } } fn send_syn(&mut self) { let mut syn = self.make_seg(); syn.set_flag(Flag::SYN); syn.set_seq(self.seq_base); self.send_seg(syn); self.state = TCBState::SynSent; } fn handle_input_recv(&mut self) { match self.data_input.recv_timeout(Duration::from_secs(TIMEOUT)) { Ok(input) => { match input { TCBInput::SendSyn => self.send_syn(), TCBInput::Receive(seg) => self.handle_seg(seg), TCBInput::Send(data) => { self.send_buffer.extend(data); self.fill_send_window(); } TCBInput::Close => { self.send_close(); } } } Err(e) if e == RecvTimeoutError::Timeout => { self.handle_resend(); } Err(e) => panic!(e), } } fn fill_send_window(&mut self) { if self.state != TCBState::Estab { return; } let orig_window_len = self.send_window.len(); let send_amt = min(self.send_buffer.len(), WINDOW_SIZE - orig_window_len); self.send_window.extend( self.send_buffer.iter().take(send_amt), ); let data_to_send = self.send_buffer.drain(..send_amt).collect::<Vec<u8>>(); let next_seq = self.seq_base.wrapping_add(orig_window_len as u32); self.send_data(data_to_send, next_seq); } fn send_data(&mut self, mut data: Vec<u8>, next_seq: u32) { let mut sent = 0; let bytes_to_send = data.len(); while sent < bytes_to_send { let size = min(MAX_PAYLOAD_SIZE, data.len()); let payload: Vec<u8> = data.drain(..size).collect(); let mut seg = self.make_seg(); seg.set_seq(next_seq.wrapping_add(sent as u32)); seg.set_data(payload); self.send_seg(seg); sent += size; } } fn handle_seg(&mut self, seg: Segment) { // println!("Got seg: {:?}", seg); self.handle_acks(&seg); // sender self.handle_shake(&seg); self.handle_payload(&seg); // receiver if seg.get_flag(Flag::FIN) { self.handle_close(); } } fn handle_payload(&mut self, seg: &Segment) { if self.state != TCBState::Estab { return; } let seq_lb = self.ack_base; let seq_ub = seq_lb.wrapping_add(WINDOW_SIZE as u32); if in_wrapped_range((seq_lb, seq_ub), seg.seq_num()) { let window_index_base = seg.seq_num().wrapping_sub(self.ack_base) as usize; for (i, byte) in seg.payload().iter().enumerate() { self.recv_window[window_index_base + i] = Some(*byte); } } else if seg.payload().len() > 0 { // println!( // "\x1b[31m Seq {} out of range (expected {}), ignoring\x1b[0m", // seg.seq_num(), // self.ack_base // ); } if seg.seq_num() == self.ack_base { loop { match self.recv_window.front() { Some(opt) => { match *opt { Some(byte) => self.byte_output.send(byte).unwrap(), None => break, } } _ => break, } self.ack_base = self.ack_base.wrapping_add(1); self.recv_window.pop_front(); self.recv_window.push_back(None); } let mut ack = self.make_seg(); ack.set_flag(Flag::ACK); ack.set_ack_num(self.ack_base); // TODO: Delayed ack self.send_ack(ack); } else if !seg.get_flag(Flag::ACK) { // println!( // "\x1b[32m Out of order Seq {} (expected {}), ignoring\x1b[0m", // seg.seq_num(), // self.ack_base // ); } } fn handle_acks(&mut self, seg: &Segment) { let ack_lb = self.seq_base.wrapping_add(1); let ack_ub = ack_lb.wrapping_add(WINDOW_SIZE as u32); if seg.get_flag(Flag::ACK) && in_wrapped_range((ack_lb, ack_ub), seg.ack_num()) { self.unacked_segs.retain(|unacked_seg: &Segment| { in_wrapped_range( ( seg.ack_num(), seg.ack_num().wrapping_add(WINDOW_SIZE as u32), ), unacked_seg.seq_num(), ) }); let num_acked_bytes = seg.ack_num().wrapping_sub(self.seq_base) as usize; self.seq_base = seg.ack_num(); // Handle payload data, only valid after Estab if self.state == TCBState::Estab { self.send_window.drain(..num_acked_bytes); self.fill_send_window(); } } let dupe_ack_lb = self.seq_base.wrapping_sub((WINDOW_SIZE - 1) as u32); let dupe_ack_ub = dupe_ack_lb.wrapping_add(WINDOW_SIZE as u32); if self.state == TCBState::Estab && seg.get_flag(Flag::ACK) && in_wrapped_range((dupe_ack_lb, dupe_ack_ub), seg.seq_num()) { self.dupe_acks += 1; if self.dupe_acks >= 3 { self.handle_resend(); self.dupe_acks = 0; // println!("\x1b[31m Triple Duplicate ACK! Resending \x1b[0m"); } } } fn handle_shake(&mut self, seg: &Segment) { match self.state { TCBState::Listen => { if seg.get_flag(Flag::SYN) { self.state = TCBState::SynRecd; self.ack_base = seg.seq_num().wrapping_add(1); let mut synack = self.make_seg(); synack.set_flag(Flag::SYN); synack.set_flag(Flag::ACK); synack.set_seq(self.seq_base); synack.set_ack_num(self.ack_base); self.send_seg(synack); } } TCBState::SynSent => { if seg.get_flag(Flag::SYN) && seg.get_flag(Flag::ACK) { self.state = TCBState::Estab; self.ack_base = seg.seq_num().wrapping_add(1); let mut ack = self.make_seg(); ack.set_flag(Flag::ACK); ack.set_ack_num(self.ack_base); self.send_ack(ack); self.fill_send_window(); } } TCBState::SynRecd => { // TODO: Verify what seq num should be here if seg.get_flag(Flag::ACK) { self.state = TCBState::Estab; self.fill_send_window(); } } TCBState::Estab => {} TCBState::Closed => {} } } fn handle_close(&mut self) { self.state = TCBState::Closed; } fn send_close(&mut self) { let mut fin = self.make_seg(); fin.set_flag(Flag::FIN); fin.set_seq(self.seq_base); self.send_seg(fin); self.state = TCBState::Closed; } fn handle_resend(&mut self) { match self.unacked_segs.front() { Some(ref seg) => self.resend_seg(&seg), _ => {} } } fn make_seg(&self) -> Segment { Segment::new(self.tuple.src.port(), self.tuple.dst.port()) } fn send_seg(&mut self, seg: Segment) { self.resend_seg(&seg); self.unacked_segs.push_back(seg); } fn send_ack(&self, seg: Segment) { self.resend_seg(&seg); } fn resend_seg(&self, seg: &Segment) { let bytes = seg.to_byte_vec(); self.socket.send_to(&bytes[..], &self.tuple.dst).unwrap(); } } #[cfg(test)] pub mod tests { use super::*; use std::thread; type TcbTup = (TCB, Sender<TCBInput>, Receiver<u8>); pub fn tcb_pair() -> (TcbTup, TcbTup, UdpSocket, UdpSocket) { let server_sock = UdpSocket::bind("127.0.0.1:0").unwrap(); let client_sock = UdpSocket::bind("127.0.0.1:0").unwrap(); let server_tuple = TCPTuple { src: server_sock.local_addr().unwrap(), dst: client_sock.local_addr().unwrap(), }; let client_tuple = TCPTuple { src: client_sock.local_addr().unwrap(), dst: server_sock.local_addr().unwrap(), }; let server_tuple = TCB::new(server_tuple, server_sock.try_clone().unwrap()); let client_tuple = TCB::new(client_tuple, client_sock.try_clone().unwrap()); (server_tuple, client_tuple, server_sock, client_sock) } fn sock_recv(sock: &UdpSocket) -> Segment { let mut buf = vec![0; (1 << 16) - 1]; let (amt, _) = sock.recv_from(&mut buf).unwrap(); buf.truncate(amt); Segment::from_buf(buf) } pub fn perform_handshake( server_tuple: &mut TcbTup, client_tuple: &mut TcbTup, server_sock: &UdpSocket, client_sock: &UdpSocket, ) { let (ref mut server_tcb, ref server_input, _) = *server_tuple; let (ref mut client_tcb, ref client_input, _) = *client_tuple; client_input.send(TCBInput::SendSyn).unwrap(); client_tcb.handle_input_recv(); assert_eq!(client_tcb.state, TCBState::SynSent); let client_syn: Segment = sock_recv(&server_sock); assert!(client_syn.get_flag(Flag::SYN)); server_input.send(TCBInput::Receive(client_syn)).unwrap(); server_tcb.handle_input_recv(); assert_eq!(server_tcb.state, TCBState::SynRecd); let server_synack: Segment = sock_recv(&client_sock); assert!(server_synack.get_flag(Flag::SYN)); assert!(server_synack.get_flag(Flag::ACK)); client_input.send(TCBInput::Receive(server_synack)).unwrap(); client_tcb.handle_input_recv(); assert_eq!(client_tcb.state, TCBState::Estab); let client_ack: Segment = sock_recv(&server_sock); assert!(client_ack.get_flag(Flag::ACK)); server_input.send(TCBInput::Receive(client_ack)).unwrap(); server_tcb.handle_input_recv(); assert_eq!(server_tcb.state, TCBState::Estab); } #[test] fn full_handshake() { let (mut server_tuple, mut client_tuple, server_sock, client_sock) = tcb_pair(); perform_handshake( &mut server_tuple, &mut client_tuple, &server_sock, &client_sock, ); } #[test] fn handshake_retransmit() { let (server_tuple, client_tuple, server_sock, client_sock) = tcb_pair(); let (mut client_tcb, client_input, _) = client_tuple; let (mut server_tcb, server_input, _) = server_tuple; let client_thread = thread::spawn(move || { client_tcb.send_syn(); while client_tcb.state != TCBState::Estab { client_tcb.handle_input_recv(); } }); sock_recv(&server_sock); let client_syn: Segment = sock_recv(&server_sock); // Wait for second send assert!(client_syn.get_flag(Flag::SYN)); server_input.send(TCBInput::Receive(client_syn)).unwrap(); server_tcb.handle_input_recv(); let server_synack: Segment = sock_recv(&client_sock); client_input.send(TCBInput::Receive(server_synack)).unwrap(); client_thread.join().unwrap(); } #[test] fn send_test() { let (mut server_tuple, mut client_tuple, server_sock, client_sock) = tcb_pair(); server_tuple.0.seq_base = u32::max_value() - 2; // Test wrapping around u32 boundaries perform_handshake( &mut server_tuple, &mut client_tuple, &server_sock, &client_sock, ); let (client_tcb, _client_input, _) = client_tuple; let (mut server_tcb, server_input, _) = server_tuple; let data_len = WINDOW_SIZE; let str = String::from("Ok"); assert!(str.len() <= MAX_PAYLOAD_SIZE); let mut data = (0..data_len).map(|r| r as u8).collect::<Vec<u8>>(); data.extend(str.clone().into_bytes()); server_input.send(TCBInput::Send(data)).unwrap(); server_tcb.handle_input_recv(); let mut segments = vec![]; for _ in 0..((data_len as f64 / MAX_PAYLOAD_SIZE as f64).ceil() as u32) { segments.push(sock_recv(&client_sock)); } let mut ack = client_tcb.make_seg(); ack.set_flag(Flag::ACK); ack.set_ack_num(segments[1].seq_num()); server_input.send(TCBInput::Receive(ack)).unwrap(); server_tcb.handle_input_recv(); let next_seg = sock_recv(&client_sock); assert_eq!(next_seg.payload(), str.into_bytes()); // Check for Duplicate ACK resends for _ in 0..5 { let mut ack = client_tcb.make_seg(); ack.set_flag(Flag::ACK); ack.set_ack_num(segments[1].seq_num()); server_input.send(TCBInput::Receive(ack)).unwrap(); server_tcb.handle_input_recv(); } let next_seg = sock_recv(&client_sock); assert_eq!(next_seg.seq_num(), segments[1].seq_num()); let next_seg = sock_recv(&client_sock); assert_eq!(next_seg.seq_num(), segments[1].seq_num()); } pub fn run_e2e_pair<F1, F2>( server_fn: F1, client_fn: F2, ) -> ((Sender<TCBInput>, Receiver<u8>, UdpSocket), (Sender<TCBInput>, Receiver<u8>, UdpSocket)) where F1: FnOnce(TCB) -> () + Send + 'static, F2: FnOnce(TCB) -> () + Send + 'static, { let (server_tuple, client_tuple, server_sock, client_sock) = tcb_pair(); let (server_tcb, server_input, server_output) = server_tuple; let (client_tcb, client_input, client_output) = client_tuple; let server_client_sender = client_input.clone(); let server_client_sock = client_sock.try_clone().unwrap(); let _server_message_passer = thread::spawn(move || loop { let seg = sock_recv(&server_client_sock); // println!("\x1b[33m Server->Client {:?} \x1b[0m", seg); if server_client_sender.send(TCBInput::Receive(seg)).is_err() { break; } }); let client_server_sender = server_input.clone(); let client_server_sock = server_sock.try_clone().unwrap(); let _client_message_passer = thread::spawn(move || loop { let seg = sock_recv(&client_server_sock); // println!("\x1b[35m Client->Server {:?} \x1b[0m", seg); if client_server_sender.send(TCBInput::Receive(seg)).is_err() { break; } }); let _server = thread::spawn(move || server_fn(server_tcb)); let _client = thread::spawn(move || client_fn(client_tcb)); ((server_input, server_output, server_sock), ( client_input, client_output, client_sock, )) } #[test] fn send_recv_test() { let ((server_input, _, _), (client_input, client_output, _)) = run_e2e_pair( |mut server_tcb: TCB| server_tcb.run_tcp(), |mut client_tcb: TCB| client_tcb.run_tcp(), ); client_input.send(TCBInput::SendSyn).unwrap(); let text = String::from("Did you ever hear the tragedy of Darth Plagueis the wise?"); let data = text.clone().into_bytes(); server_input.send(TCBInput::Send(data)).unwrap(); let mut buf = vec![]; while buf.len() < text.len() { buf.extend(client_output.recv()); } assert_eq!(String::from_utf8(buf).unwrap(), text); } #[test] fn close_test() { let (mut server_tuple, mut client_tuple, server_sock, client_sock) = tcb_pair(); perform_handshake( &mut server_tuple, &mut client_tuple, &server_sock, &client_sock, ); let (mut server_tcb, server_input, _) = server_tuple; let (mut client_tcb, client_input, _) = client_tuple; client_input.send(TCBInput::Close).unwrap(); client_tcb.handle_input_recv(); let client_fin = sock_recv(&server_sock); server_input.send(TCBInput::Receive(client_fin)).unwrap(); server_tcb.handle_input_recv(); assert_eq!(server_tcb.state, TCBState::Closed); assert_eq!(client_tcb.state, TCBState::Closed); } }
#[doc = "Reader of register ISR"] pub type R = crate::R<u32, super::ISR>; #[doc = "Writer for register ISR"] pub type W = crate::W<u32, super::ISR>; #[doc = "Register ISR `reset()`'s with value 0"] impl crate::ResetValue for super::ISR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Injected context queue overflow\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JQOVF_A { #[doc = "0: No injected context queue overflow has occurred"] NOOVERFLOW = 0, #[doc = "1: Injected context queue overflow has occurred"] OVERFLOW = 1, } impl From<JQOVF_A> for bool { #[inline(always)] fn from(variant: JQOVF_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `JQOVF`"] pub type JQOVF_R = crate::R<bool, JQOVF_A>; impl JQOVF_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> JQOVF_A { match self.bits { false => JQOVF_A::NOOVERFLOW, true => JQOVF_A::OVERFLOW, } } #[doc = "Checks if the value of the field is `NOOVERFLOW`"] #[inline(always)] pub fn is_no_overflow(&self) -> bool { *self == JQOVF_A::NOOVERFLOW } #[doc = "Checks if the value of the field is `OVERFLOW`"] #[inline(always)] pub fn is_overflow(&self) -> bool { *self == JQOVF_A::OVERFLOW } } #[doc = "Injected context queue overflow\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JQOVF_AW { #[doc = "1: Clear injected context queue overflow flag"] CLEAR = 1, } impl From<JQOVF_AW> for bool { #[inline(always)] fn from(variant: JQOVF_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `JQOVF`"] pub struct JQOVF_W<'a> { w: &'a mut W, } impl<'a> JQOVF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: JQOVF_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear injected context queue overflow flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(JQOVF_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); self.w } } #[doc = "Analog watchdog 3 flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum AWD3_A { #[doc = "0: No analog watchdog event occurred"] NOEVENT = 0, #[doc = "1: Analog watchdog event occurred"] EVENT = 1, } impl From<AWD3_A> for bool { #[inline(always)] fn from(variant: AWD3_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `AWD3`"] pub type AWD3_R = crate::R<bool, AWD3_A>; impl AWD3_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> AWD3_A { match self.bits { false => AWD3_A::NOEVENT, true => AWD3_A::EVENT, } } #[doc = "Checks if the value of the field is `NOEVENT`"] #[inline(always)] pub fn is_no_event(&self) -> bool { *self == AWD3_A::NOEVENT } #[doc = "Checks if the value of the field is `EVENT`"] #[inline(always)] pub fn is_event(&self) -> bool { *self == AWD3_A::EVENT } } #[doc = "Analog watchdog 3 flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum AWD3_AW { #[doc = "1: Clear analog watchdog event occurred flag"] CLEAR = 1, } impl From<AWD3_AW> for bool { #[inline(always)] fn from(variant: AWD3_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `AWD3`"] pub struct AWD3_W<'a> { w: &'a mut W, } impl<'a> AWD3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AWD3_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear analog watchdog event occurred flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(AWD3_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); self.w } } #[doc = "Analog watchdog 2 flag"] pub type AWD2_A = AWD3_A; #[doc = "Reader of field `AWD2`"] pub type AWD2_R = crate::R<bool, AWD3_A>; #[doc = "Analog watchdog 2 flag"] pub type AWD2_AW = AWD3_AW; #[doc = "Write proxy for field `AWD2`"] pub struct AWD2_W<'a> { w: &'a mut W, } impl<'a> AWD2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AWD2_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear analog watchdog event occurred flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(AWD3_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); self.w } } #[doc = "Analog watchdog 1 flag"] pub type AWD1_A = AWD3_A; #[doc = "Reader of field `AWD1`"] pub type AWD1_R = crate::R<bool, AWD3_A>; #[doc = "Analog watchdog 1 flag"] pub type AWD1_AW = AWD3_AW; #[doc = "Write proxy for field `AWD1`"] pub struct AWD1_W<'a> { w: &'a mut W, } impl<'a> AWD1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: AWD1_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear analog watchdog event occurred flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(AWD3_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Injected channel end of sequence flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JEOS_A { #[doc = "0: Injected sequence is not complete"] NOTCOMPLETE = 0, #[doc = "1: Injected sequence complete"] COMPLETE = 1, } impl From<JEOS_A> for bool { #[inline(always)] fn from(variant: JEOS_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `JEOS`"] pub type JEOS_R = crate::R<bool, JEOS_A>; impl JEOS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> JEOS_A { match self.bits { false => JEOS_A::NOTCOMPLETE, true => JEOS_A::COMPLETE, } } #[doc = "Checks if the value of the field is `NOTCOMPLETE`"] #[inline(always)] pub fn is_not_complete(&self) -> bool { *self == JEOS_A::NOTCOMPLETE } #[doc = "Checks if the value of the field is `COMPLETE`"] #[inline(always)] pub fn is_complete(&self) -> bool { *self == JEOS_A::COMPLETE } } #[doc = "Injected channel end of sequence flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JEOS_AW { #[doc = "1: Clear Injected sequence complete flag"] CLEAR = 1, } impl From<JEOS_AW> for bool { #[inline(always)] fn from(variant: JEOS_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `JEOS`"] pub struct JEOS_W<'a> { w: &'a mut W, } impl<'a> JEOS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: JEOS_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear Injected sequence complete flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(JEOS_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); self.w } } #[doc = "Injected channel end of conversion flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JEOC_A { #[doc = "0: Injected conversion is not complete"] NOTCOMPLETE = 0, #[doc = "1: Injected conversion complete"] COMPLETE = 1, } impl From<JEOC_A> for bool { #[inline(always)] fn from(variant: JEOC_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `JEOC`"] pub type JEOC_R = crate::R<bool, JEOC_A>; impl JEOC_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> JEOC_A { match self.bits { false => JEOC_A::NOTCOMPLETE, true => JEOC_A::COMPLETE, } } #[doc = "Checks if the value of the field is `NOTCOMPLETE`"] #[inline(always)] pub fn is_not_complete(&self) -> bool { *self == JEOC_A::NOTCOMPLETE } #[doc = "Checks if the value of the field is `COMPLETE`"] #[inline(always)] pub fn is_complete(&self) -> bool { *self == JEOC_A::COMPLETE } } #[doc = "Injected channel end of conversion flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum JEOC_AW { #[doc = "1: Clear injected conversion complete flag"] CLEAR = 1, } impl From<JEOC_AW> for bool { #[inline(always)] fn from(variant: JEOC_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `JEOC`"] pub struct JEOC_W<'a> { w: &'a mut W, } impl<'a> JEOC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: JEOC_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear injected conversion complete flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(JEOC_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5); self.w } } #[doc = "ADC overrun\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OVR_A { #[doc = "0: No overrun occurred"] NOOVERRUN = 0, #[doc = "1: Overrun occurred"] OVERRUN = 1, } impl From<OVR_A> for bool { #[inline(always)] fn from(variant: OVR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `OVR`"] pub type OVR_R = crate::R<bool, OVR_A>; impl OVR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OVR_A { match self.bits { false => OVR_A::NOOVERRUN, true => OVR_A::OVERRUN, } } #[doc = "Checks if the value of the field is `NOOVERRUN`"] #[inline(always)] pub fn is_no_overrun(&self) -> bool { *self == OVR_A::NOOVERRUN } #[doc = "Checks if the value of the field is `OVERRUN`"] #[inline(always)] pub fn is_overrun(&self) -> bool { *self == OVR_A::OVERRUN } } #[doc = "ADC overrun\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OVR_AW { #[doc = "1: Clear overrun occurred flag"] CLEAR = 1, } impl From<OVR_AW> for bool { #[inline(always)] fn from(variant: OVR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `OVR`"] pub struct OVR_W<'a> { w: &'a mut W, } impl<'a> OVR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OVR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear overrun occurred flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(OVR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4); self.w } } #[doc = "End of regular sequence flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOS_A { #[doc = "0: Regular sequence is not complete"] NOTCOMPLETE = 0, #[doc = "1: Regular sequence complete"] COMPLETE = 1, } impl From<EOS_A> for bool { #[inline(always)] fn from(variant: EOS_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `EOS`"] pub type EOS_R = crate::R<bool, EOS_A>; impl EOS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOS_A { match self.bits { false => EOS_A::NOTCOMPLETE, true => EOS_A::COMPLETE, } } #[doc = "Checks if the value of the field is `NOTCOMPLETE`"] #[inline(always)] pub fn is_not_complete(&self) -> bool { *self == EOS_A::NOTCOMPLETE } #[doc = "Checks if the value of the field is `COMPLETE`"] #[inline(always)] pub fn is_complete(&self) -> bool { *self == EOS_A::COMPLETE } } #[doc = "End of regular sequence flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOS_AW { #[doc = "1: Clear regular sequence complete flag"] CLEAR = 1, } impl From<EOS_AW> for bool { #[inline(always)] fn from(variant: EOS_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `EOS`"] pub struct EOS_W<'a> { w: &'a mut W, } impl<'a> EOS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOS_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear regular sequence complete flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(EOS_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); self.w } } #[doc = "End of conversion flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOC_A { #[doc = "0: Regular conversion is not complete"] NOTCOMPLETE = 0, #[doc = "1: Regular conversion complete"] COMPLETE = 1, } impl From<EOC_A> for bool { #[inline(always)] fn from(variant: EOC_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `EOC`"] pub type EOC_R = crate::R<bool, EOC_A>; impl EOC_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOC_A { match self.bits { false => EOC_A::NOTCOMPLETE, true => EOC_A::COMPLETE, } } #[doc = "Checks if the value of the field is `NOTCOMPLETE`"] #[inline(always)] pub fn is_not_complete(&self) -> bool { *self == EOC_A::NOTCOMPLETE } #[doc = "Checks if the value of the field is `COMPLETE`"] #[inline(always)] pub fn is_complete(&self) -> bool { *self == EOC_A::COMPLETE } } #[doc = "End of conversion flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOC_AW { #[doc = "1: Clear regular conversion complete flag"] CLEAR = 1, } impl From<EOC_AW> for bool { #[inline(always)] fn from(variant: EOC_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `EOC`"] pub struct EOC_W<'a> { w: &'a mut W, } impl<'a> EOC_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOC_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear regular conversion complete flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(EOC_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2); self.w } } #[doc = "End of sampling flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOSMP_A { #[doc = "0: End of sampling phase no yet reached"] NOTENDED = 0, #[doc = "1: End of sampling phase reached"] ENDED = 1, } impl From<EOSMP_A> for bool { #[inline(always)] fn from(variant: EOSMP_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `EOSMP`"] pub type EOSMP_R = crate::R<bool, EOSMP_A>; impl EOSMP_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOSMP_A { match self.bits { false => EOSMP_A::NOTENDED, true => EOSMP_A::ENDED, } } #[doc = "Checks if the value of the field is `NOTENDED`"] #[inline(always)] pub fn is_not_ended(&self) -> bool { *self == EOSMP_A::NOTENDED } #[doc = "Checks if the value of the field is `ENDED`"] #[inline(always)] pub fn is_ended(&self) -> bool { *self == EOSMP_A::ENDED } } #[doc = "End of sampling flag\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOSMP_AW { #[doc = "1: Clear end of sampling phase reached flag"] CLEAR = 1, } impl From<EOSMP_AW> for bool { #[inline(always)] fn from(variant: EOSMP_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `EOSMP`"] pub struct EOSMP_W<'a> { w: &'a mut W, } impl<'a> EOSMP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOSMP_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear end of sampling phase reached flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(EOSMP_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); self.w } } #[doc = "ADC ready\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADRDY_A { #[doc = "0: ADC is not ready to start conversion"] NOTREADY = 0, #[doc = "1: ADC is ready to start conversion"] READY = 1, } impl From<ADRDY_A> for bool { #[inline(always)] fn from(variant: ADRDY_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `ADRDY`"] pub type ADRDY_R = crate::R<bool, ADRDY_A>; impl ADRDY_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ADRDY_A { match self.bits { false => ADRDY_A::NOTREADY, true => ADRDY_A::READY, } } #[doc = "Checks if the value of the field is `NOTREADY`"] #[inline(always)] pub fn is_not_ready(&self) -> bool { *self == ADRDY_A::NOTREADY } #[doc = "Checks if the value of the field is `READY`"] #[inline(always)] pub fn is_ready(&self) -> bool { *self == ADRDY_A::READY } } #[doc = "ADC ready\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADRDY_AW { #[doc = "1: Clear ADC is ready to start conversion flag"] CLEAR = 1, } impl From<ADRDY_AW> for bool { #[inline(always)] fn from(variant: ADRDY_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `ADRDY`"] pub struct ADRDY_W<'a> { w: &'a mut W, } impl<'a> ADRDY_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ADRDY_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear ADC is ready to start conversion flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(ADRDY_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); self.w } } impl R { #[doc = "Bit 10 - Injected context queue overflow"] #[inline(always)] pub fn jqovf(&self) -> JQOVF_R { JQOVF_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 9 - Analog watchdog 3 flag"] #[inline(always)] pub fn awd3(&self) -> AWD3_R { AWD3_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 8 - Analog watchdog 2 flag"] #[inline(always)] pub fn awd2(&self) -> AWD2_R { AWD2_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 7 - Analog watchdog 1 flag"] #[inline(always)] pub fn awd1(&self) -> AWD1_R { AWD1_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 6 - Injected channel end of sequence flag"] #[inline(always)] pub fn jeos(&self) -> JEOS_R { JEOS_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 5 - Injected channel end of conversion flag"] #[inline(always)] pub fn jeoc(&self) -> JEOC_R { JEOC_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 4 - ADC overrun"] #[inline(always)] pub fn ovr(&self) -> OVR_R { OVR_R::new(((self.bits >> 4) & 0x01) != 0) } #[doc = "Bit 3 - End of regular sequence flag"] #[inline(always)] pub fn eos(&self) -> EOS_R { EOS_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 2 - End of conversion flag"] #[inline(always)] pub fn eoc(&self) -> EOC_R { EOC_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 1 - End of sampling flag"] #[inline(always)] pub fn eosmp(&self) -> EOSMP_R { EOSMP_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 0 - ADC ready"] #[inline(always)] pub fn adrdy(&self) -> ADRDY_R { ADRDY_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bit 10 - Injected context queue overflow"] #[inline(always)] pub fn jqovf(&mut self) -> JQOVF_W { JQOVF_W { w: self } } #[doc = "Bit 9 - Analog watchdog 3 flag"] #[inline(always)] pub fn awd3(&mut self) -> AWD3_W { AWD3_W { w: self } } #[doc = "Bit 8 - Analog watchdog 2 flag"] #[inline(always)] pub fn awd2(&mut self) -> AWD2_W { AWD2_W { w: self } } #[doc = "Bit 7 - Analog watchdog 1 flag"] #[inline(always)] pub fn awd1(&mut self) -> AWD1_W { AWD1_W { w: self } } #[doc = "Bit 6 - Injected channel end of sequence flag"] #[inline(always)] pub fn jeos(&mut self) -> JEOS_W { JEOS_W { w: self } } #[doc = "Bit 5 - Injected channel end of conversion flag"] #[inline(always)] pub fn jeoc(&mut self) -> JEOC_W { JEOC_W { w: self } } #[doc = "Bit 4 - ADC overrun"] #[inline(always)] pub fn ovr(&mut self) -> OVR_W { OVR_W { w: self } } #[doc = "Bit 3 - End of regular sequence flag"] #[inline(always)] pub fn eos(&mut self) -> EOS_W { EOS_W { w: self } } #[doc = "Bit 2 - End of conversion flag"] #[inline(always)] pub fn eoc(&mut self) -> EOC_W { EOC_W { w: self } } #[doc = "Bit 1 - End of sampling flag"] #[inline(always)] pub fn eosmp(&mut self) -> EOSMP_W { EOSMP_W { w: self } } #[doc = "Bit 0 - ADC ready"] #[inline(always)] pub fn adrdy(&mut self) -> ADRDY_W { ADRDY_W { w: self } } }
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // See the License for the specific language governing permissions and // limitations under the License. use std::sync::Arc; use prometheus::{Gauge, GaugeVec}; use rocksdb::{DB, DBStatisticsTickerType as TickerType, DBStatisticsHistogramType as HistType, HistogramData}; use storage::ALL_CFS; use util::rocksdb; pub const ROCKSDB_TOTAL_SST_FILES_SIZE: &'static str = "rocksdb.total-sst-files-size"; pub const ROCKSDB_TABLE_READERS_MEM: &'static str = "rocksdb.estimate-table-readers-mem"; pub const ROCKSDB_CUR_SIZE_ALL_MEM_TABLES: &'static str = "rocksdb.cur-size-all-mem-tables"; pub const ROCKSDB_ESTIMATE_NUM_KEYS: &'static str = "rocksdb.estimate-num-keys"; pub const ROCKSDB_ESTIMATE_PENDING_COMPACTION_BYTES: &'static str = "rocksdb.\ estimate-pending-compaction-bytes"; pub const ENGINE_TICKER_TYPES: &'static [TickerType] = &[TickerType::BlockCacheMiss, TickerType::BlockCacheHit, TickerType::MemtableHit, TickerType::MemtableMiss, TickerType::GetHitL0, TickerType::GetHitL1, TickerType::GetHitL2AndUp, TickerType::BloomFilterUseful, TickerType::BloomFilterPrefixChecked, TickerType::BloomFilterPrefixUseful, TickerType::NumberKeysWritten, TickerType::NumberKeysRead, TickerType::BytesWritten, TickerType::BytesRead, TickerType::IterBytesRead, TickerType::StallMicros, TickerType::CompactReadBytes, TickerType::CompactWriteBytes]; pub const ENGINE_HIST_TYPES: &'static [HistType] = &[HistType::GetMicros, HistType::WriteMicros, HistType::SeekMicros]; pub fn flush_engine_ticker_metrics(t: TickerType, value: u64) { match t { TickerType::BlockCacheMiss => { STORE_ENGINE_CACHE_EFFICIENCY_VEC.with_label_values(&["block_cache_miss"]) .set(value as f64); } TickerType::BlockCacheHit => { STORE_ENGINE_CACHE_EFFICIENCY_VEC.with_label_values(&["block_cache_hit"]) .set(value as f64); } TickerType::MemtableHit => { STORE_ENGINE_MEMTABLE_EFFICIENCY_VEC.with_label_values(&["memtable_hit"]) .set(value as f64); } TickerType::MemtableMiss => { STORE_ENGINE_MEMTABLE_EFFICIENCY_VEC.with_label_values(&["memtable_miss"]) .set(value as f64); } TickerType::GetHitL0 => { STORE_ENGINE_READ_SURVED_VEC.with_label_values(&["get_hit_l0"]).set(value as f64); } TickerType::GetHitL1 => { STORE_ENGINE_READ_SURVED_VEC.with_label_values(&["get_hit_l1"]).set(value as f64); } TickerType::GetHitL2AndUp => { STORE_ENGINE_READ_SURVED_VEC.with_label_values(&["get_hit_l2_and_up"]) .set(value as f64); } TickerType::BloomFilterUseful => { STORE_ENGINE_BLOOM_EFFICIENCY_VEC.with_label_values(&["bloom_useful"]) .set(value as f64); } TickerType::BloomFilterPrefixChecked => { STORE_ENGINE_BLOOM_EFFICIENCY_VEC.with_label_values(&["bloom_prefix_checked"]) .set(value as f64); } TickerType::BloomFilterPrefixUseful => { STORE_ENGINE_BLOOM_EFFICIENCY_VEC.with_label_values(&["bloom_prefix_useful"]) .set(value as f64); } TickerType::NumberKeysWritten => { STORE_ENGINE_FLOW_VEC.with_label_values(&["keys_written"]).set(value as f64); } TickerType::NumberKeysRead => { STORE_ENGINE_FLOW_VEC.with_label_values(&["keys_read"]).set(value as f64); } TickerType::BytesWritten => { STORE_ENGINE_FLOW_VEC.with_label_values(&["bytes_written"]).set(value as f64); } TickerType::BytesRead => { STORE_ENGINE_FLOW_VEC.with_label_values(&["bytes_read"]).set(value as f64); } TickerType::IterBytesRead => { STORE_ENGINE_FLOW_VEC.with_label_values(&["iter_bytes_read"]).set(value as f64); } TickerType::StallMicros => { STORE_ENGINE_STALL_MICROS.set(value as f64); } TickerType::CompactReadBytes => { STORE_ENGINE_COMPACTION_FLOW_VEC.with_label_values(&["bytes_read"]).set(value as f64); } TickerType::CompactWriteBytes => { STORE_ENGINE_COMPACTION_FLOW_VEC.with_label_values(&["bytes_written"]) .set(value as f64); } _ => {} } } pub fn flush_engine_histogram_metrics(t: HistType, value: HistogramData) { match t { HistType::GetMicros => { STORE_ENGINE_GET_MICROS_VEC.with_label_values(&["get_median"]).set(value.median); STORE_ENGINE_GET_MICROS_VEC.with_label_values(&["get_percentile95"]) .set(value.percentile95); STORE_ENGINE_GET_MICROS_VEC.with_label_values(&["get_percentile99"]) .set(value.percentile99); STORE_ENGINE_GET_MICROS_VEC.with_label_values(&["get_average"]).set(value.average); STORE_ENGINE_GET_MICROS_VEC.with_label_values(&["get_standard_deviation"]) .set(value.standard_deviation); } HistType::WriteMicros => { STORE_ENGINE_WRITE_MICROS_VEC.with_label_values(&["write_median"]).set(value.median); STORE_ENGINE_WRITE_MICROS_VEC.with_label_values(&["write_percentile95"]) .set(value.percentile95); STORE_ENGINE_WRITE_MICROS_VEC.with_label_values(&["write_percentile99"]) .set(value.percentile99); STORE_ENGINE_WRITE_MICROS_VEC.with_label_values(&["write_average"]).set(value.average); STORE_ENGINE_WRITE_MICROS_VEC.with_label_values(&["write_standard_deviation"]) .set(value.standard_deviation); } HistType::SeekMicros => { STORE_ENGINE_SEEK_MICROS_VEC.with_label_values(&["seek_median"]).set(value.median); STORE_ENGINE_SEEK_MICROS_VEC.with_label_values(&["seek_percentile95"]) .set(value.percentile95); STORE_ENGINE_SEEK_MICROS_VEC.with_label_values(&["seek_percentile99"]) .set(value.percentile99); STORE_ENGINE_SEEK_MICROS_VEC.with_label_values(&["seek_average"]).set(value.average); STORE_ENGINE_SEEK_MICROS_VEC.with_label_values(&["seek_standard_deviation"]) .set(value.standard_deviation); } } } pub fn flush_engine_properties_and_get_used_size(engine: Arc<DB>) -> u64 { let mut used_size: u64 = 0; for cf in ALL_CFS { let handle = rocksdb::get_cf_handle(&engine, cf).unwrap(); let cf_used_size = engine.get_property_int_cf(handle, ROCKSDB_TOTAL_SST_FILES_SIZE) .expect("rocksdb is too old, missing total-sst-files-size property"); // For block cache usage let block_cache_usage = engine.get_block_cache_usage_cf(handle); STORE_ENGINE_BLOCK_CACHE_USAGE_GAUGE_VEC.with_label_values(&[cf]) .set(block_cache_usage as f64); // It is important to monitor each cf's size, especially the "raft" and "lock" column // families. STORE_ENGINE_SIZE_GAUGE_VEC.with_label_values(&[cf]).set(cf_used_size as f64); used_size += cf_used_size; // TODO: find a better place to record these metrics. // Refer: https://github.com/facebook/rocksdb/wiki/Memory-usage-in-RocksDB // For index and filter blocks memory if let Some(readers_mem) = engine.get_property_int_cf(handle, ROCKSDB_TABLE_READERS_MEM) { STORE_ENGINE_MEMORY_GAUGE_VEC.with_label_values(&[cf, "readers-mem"]) .set(readers_mem as f64); } // For memtable if let Some(mem_table) = engine.get_property_int_cf(handle, ROCKSDB_CUR_SIZE_ALL_MEM_TABLES) { STORE_ENGINE_MEMORY_GAUGE_VEC.with_label_values(&[cf, "mem-tables"]) .set(mem_table as f64); used_size += mem_table; } // TODO: add cache usage and pinned usage. if let Some(num_keys) = engine.get_property_int_cf(handle, ROCKSDB_ESTIMATE_NUM_KEYS) { STORE_ENGINE_ESTIMATE_NUM_KEYS_VEC.with_label_values(&[cf]) .set(num_keys as f64); } // Pending compaction bytes if let Some(pending_compaction_bytes) = engine.get_property_int_cf(handle, ROCKSDB_ESTIMATE_PENDING_COMPACTION_BYTES) { STORE_ENGINE_PENDING_COMACTION_BYTES_VEC.with_label_values(&[cf]) .set(pending_compaction_bytes as f64); } } used_size } lazy_static!{ pub static ref STORE_ENGINE_SIZE_GAUGE_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_size_bytes", "Sizes of each column families.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_BLOCK_CACHE_USAGE_GAUGE_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_block_cache_size_bytes", "Usage of each column families' block cache.", &["cf"] ).unwrap(); pub static ref STORE_ENGINE_MEMORY_GAUGE_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_memory_bytes", "Sizes of each column families.", &["cf", "type"] ).unwrap(); pub static ref STORE_ENGINE_ESTIMATE_NUM_KEYS_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_estimate_num_keys", "Estimate num keys of each column families.", &["cf"] ).unwrap(); pub static ref STORE_ENGINE_CACHE_EFFICIENCY_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_cache_efficiency", "Efficiency of rocksdb's block cache.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_MEMTABLE_EFFICIENCY_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_memtable_efficiency", "Hit and miss of memtable.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_READ_SURVED_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_get_served", "Get queries served by.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_BLOOM_EFFICIENCY_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_bloom_efficiency", "Efficiency of rocksdb's bloom filter.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_FLOW_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_flow_bytes", "Bytes and keys of read/written.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_STALL_MICROS: Gauge = register_gauge!( "tikv_engine_stall_micro_seconds", "Stall micros." ).unwrap(); pub static ref STORE_ENGINE_GET_MICROS_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_get_micro_seconds", "Get micros histogram.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_WRITE_MICROS_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_write_micro_seconds", "Write micros histogram.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_SEEK_MICROS_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_seek_micro_seconds", "Seek micros histogram.", &["type"] ).unwrap(); pub static ref STORE_ENGINE_PENDING_COMACTION_BYTES_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_pending_compaction_bytes", "Pending compaction bytes.", &["cf"] ).unwrap(); pub static ref STORE_ENGINE_COMPACTION_FLOW_VEC: GaugeVec = register_gauge_vec!( "tikv_engine_compaction_flow_bytes", "Bytes of read/written during compaction.", &["type"] ).unwrap(); }
use std::collections::HashMap; use std::env; use std::error::Error; use std::path::Path; use std::str; use colored::*; use log::*; use serde_json::json; use tokio::process::Command; use crate::ext::rust::PathExt; use crate::stack::parser::AWSService; const LOCALSTACK_LAMBDA_ENDPOINT: &str = "http://localhost:4574"; pub async fn wait_for_it() -> Result<(), Box<dyn Error>> { let mut ready: bool = false; while !ready { warn!("waiting for localstack's lambda to be ready.."); let cmd = Command::new("aws") .arg("lambda") .arg("list-functions") .args(&["--endpoint-url", LOCALSTACK_LAMBDA_ENDPOINT]) .status() .await?; if cmd.success() { ready = true; } } Ok(()) } pub async fn deploy((name, service): (String, AWSService)) { match service { AWSService::Lambda { runtime, handler, env_file, function_name, env_vars, files, function_path, } => { info!( "deploying lambda service '{}' at '{}'", name.yellow(), function_path.yellow() ); let wd = env::current_dir().expect("failed to get current working dir"); env::set_current_dir(function_path).expect("failed to change dir"); if function_exists(&function_name).await { Command::new("aws") .arg("lambda") .arg("delete-function") .args(&["--output", "table"]) .args(&["--function-name", &function_name]) .args(&["--endpoint-url", LOCALSTACK_LAMBDA_ENDPOINT]) .status() .await .expect("failed to delete lambda"); } let zipfile = create_zip(&name, files).await; let vars = variables(env_file, env_vars); Command::new("aws") .arg("lambda") .arg("create-function") .args(&["--output", "table"]) .args(&["--runtime", &runtime]) .args(&["--handler", &handler]) .args(&["--environment", &vars]) .args(&["--function-name", &function_name]) .args(&["--zip-file", &format!("fileb://{}", zipfile)]) .args(&["--role", "arn:aws:iam::000000000000:role/sup"]) .args(&["--endpoint-url", LOCALSTACK_LAMBDA_ENDPOINT]) .status() .await .expect("failed to create lambda"); info!( "lambda function '{}' has been deployed", function_name.yellow() ); delete_zip(zipfile).await; env::set_current_dir(wd).expect("failed to change dir"); } _ => (), } } fn variables(env_file: String, env_vars: HashMap<String, String>) -> String { // src: https://docs.rs/configurable/0.3.3/src/configurable/env.rs.html#22-38 // https://github.com/museun/configurable/issues/4 let mut vars = std::fs::read_to_string(env_file) .map(|data| { data.lines() .filter(|s| !s.starts_with('#')) .filter_map(|line| { let mut line = line.splitn(2, '=').map(str::trim); Some((line.next()?.into(), line.next()?.into())) }) .collect() }) .unwrap_or_else(|_| HashMap::new()); for (k, v) in env_vars { vars.insert(k, v); } return json!({ "Variables": vars }).to_string(); } async fn function_exists(function_name: &str) -> bool { let status = Command::new("aws") .arg("lambda") .arg("get-function") .args(&["--function-name", &function_name]) .args(&["--endpoint-url", LOCALSTACK_LAMBDA_ENDPOINT]) .status() .await .expect("failed to check for function"); if status.success() { return true; } else { return false; } } async fn create_zip(name: &str, files: Vec<String>) -> String { info!("Create zipfile for ({}) files", files.join(", ")); // TODO: replace sup with unique dynamic value let zipfile = format!("{}_{}.zip", name, "sup"); // create empty zip file Command::new("zip") .args(&[&zipfile]) .status() .await .expect("failed to create zip file"); // add files and directories to the zip file if they exist for file in files { if Path::new(&file).does_not_exist() { warn!("file '{}' does not exist, skip..", file.yellow()); continue; } Command::new("zip") .args(&["-ru", &zipfile, &file]) .status() .await .expect("failed to add file to the zip file"); } info!("zip file has been created"); return zipfile; } async fn delete_zip(zipfile: String) { info!("Cleanup ..."); Command::new("rm") .args(&[&zipfile]) .status() .await .expect("failed to delete zip file"); }
use sqs_executor::errors::{ CheckedError, Recoverable, }; #[derive(thiserror::Error, Debug)] pub enum NodeIdentifierError { #[error("Unexpected error")] Unexpected, } impl CheckedError for NodeIdentifierError { fn error_type(&self) -> Recoverable { Recoverable::Transient } }
#![feature(dbg_macro)] #[macro_use] extern crate aoc_runner_derive; use aoc_runner_derive::aoc_lib; pub mod day1; pub mod day2; aoc_lib! { year = 2018 }
use cc::Build; use dunce::canonicalize; use std::{env, path::PathBuf}; const HEADER_FILES: &[&str] = &["imath.h", "imrat.h", "iprime.h"]; const SRC_FILES: &[&str] = &["imath.c", "imrat.c", "iprime.c"]; const FUNCTION_REG: &str = "mp_.*"; const VAR_REG: &str = "(mp|MP)_.*"; const TYPE_REG: &str = "((mp_.*)|mpq_t|mpz_t)"; fn main() { let root_dir = canonicalize(PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())).unwrap(); let src = root_dir.join("vendor").join("imath"); let headers: Vec<_> = HEADER_FILES.iter().map(|head| src.join(head)).collect(); let sources: Vec<_> = SRC_FILES.iter().map(|head| src.join(head)).collect(); let mut source_builder = Build::new(); for path in &sources { source_builder.file(path); } source_builder.include(&src).compile("imath"); // Tell cargo to invalidate the built crate whenever the headers change for path in &headers { println!("cargo:rerun-if-changed={}", path.display()); } let mut bindings_builder = bindgen::builder(); // Add all headers for path in &headers { bindings_builder = bindings_builder.header(format!("{}", path.display())); } // Parse and generate source let bindings = bindings_builder .use_core() .allowlist_function(FUNCTION_REG) .allowlist_type(TYPE_REG) .allowlist_var(VAR_REG) // Current MSRV is 1.64.0, see top-level README.md file .rust_target(bindgen::RustTarget::Stable_1_64) .generate() .expect("Unable to generate bindings"); // Write the bindings to the $OUT_DIR/bindings.rs file. let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); bindings .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); }
#[doc = "Reader of register SR"] pub type R = crate::R<u32, super::SR>; #[doc = "Writer for register SR"] pub type W = crate::W<u32, super::SR>; #[doc = "Register SR `reset()`'s with value 0x04"] impl crate::ResetValue for super::SR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0x04 } } #[doc = "Write/erase operations in progress\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum BSY_A { #[doc = "0: No write/erase operation is in progress"] INACTIVE = 0, #[doc = "1: No write/erase operation is in progress"] ACTIVE = 1, } impl From<BSY_A> for bool { #[inline(always)] fn from(variant: BSY_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `BSY`"] pub type BSY_R = crate::R<bool, BSY_A>; impl BSY_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> BSY_A { match self.bits { false => BSY_A::INACTIVE, true => BSY_A::ACTIVE, } } #[doc = "Checks if the value of the field is `INACTIVE`"] #[inline(always)] pub fn is_inactive(&self) -> bool { *self == BSY_A::INACTIVE } #[doc = "Checks if the value of the field is `ACTIVE`"] #[inline(always)] pub fn is_active(&self) -> bool { *self == BSY_A::ACTIVE } } #[doc = "End of operation\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum EOP_A { #[doc = "0: No EOP operation occurred"] NOEVENT = 0, #[doc = "1: An EOP event occurred"] EVENT = 1, } impl From<EOP_A> for bool { #[inline(always)] fn from(variant: EOP_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `EOP`"] pub type EOP_R = crate::R<bool, EOP_A>; impl EOP_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> EOP_A { match self.bits { false => EOP_A::NOEVENT, true => EOP_A::EVENT, } } #[doc = "Checks if the value of the field is `NOEVENT`"] #[inline(always)] pub fn is_no_event(&self) -> bool { *self == EOP_A::NOEVENT } #[doc = "Checks if the value of the field is `EVENT`"] #[inline(always)] pub fn is_event(&self) -> bool { *self == EOP_A::EVENT } } #[doc = "Write proxy for field `EOP`"] pub struct EOP_W<'a> { w: &'a mut W, } impl<'a> EOP_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: EOP_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "No EOP operation occurred"] #[inline(always)] pub fn no_event(self) -> &'a mut W { self.variant(EOP_A::NOEVENT) } #[doc = "An EOP event occurred"] #[inline(always)] pub fn event(self) -> &'a mut W { self.variant(EOP_A::EVENT) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); self.w } } #[doc = "End of high voltage\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ENDHV_A { #[doc = "0: High voltage is executing a write/erase operation in the NVM"] ACTIVE = 0, #[doc = "1: High voltage is off, no write/erase operation is ongoing"] INACTIVE = 1, } impl From<ENDHV_A> for bool { #[inline(always)] fn from(variant: ENDHV_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `ENDHV`"] pub type ENDHV_R = crate::R<bool, ENDHV_A>; impl ENDHV_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> ENDHV_A { match self.bits { false => ENDHV_A::ACTIVE, true => ENDHV_A::INACTIVE, } } #[doc = "Checks if the value of the field is `ACTIVE`"] #[inline(always)] pub fn is_active(&self) -> bool { *self == ENDHV_A::ACTIVE } #[doc = "Checks if the value of the field is `INACTIVE`"] #[inline(always)] pub fn is_inactive(&self) -> bool { *self == ENDHV_A::INACTIVE } } #[doc = "Flash memory module ready after low power mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum READY_A { #[doc = "0: The NVM is not ready"] NOTREADY = 0, #[doc = "1: The NVM is ready"] READY = 1, } impl From<READY_A> for bool { #[inline(always)] fn from(variant: READY_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `READY`"] pub type READY_R = crate::R<bool, READY_A>; impl READY_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> READY_A { match self.bits { false => READY_A::NOTREADY, true => READY_A::READY, } } #[doc = "Checks if the value of the field is `NOTREADY`"] #[inline(always)] pub fn is_not_ready(&self) -> bool { *self == READY_A::NOTREADY } #[doc = "Checks if the value of the field is `READY`"] #[inline(always)] pub fn is_ready(&self) -> bool { *self == READY_A::READY } } #[doc = "Write protected error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WRPERR_A { #[doc = "0: No protection error happened"] NOERROR = 0, #[doc = "1: One protection error happened"] ERROR = 1, } impl From<WRPERR_A> for bool { #[inline(always)] fn from(variant: WRPERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `WRPERR`"] pub type WRPERR_R = crate::R<bool, WRPERR_A>; impl WRPERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WRPERR_A { match self.bits { false => WRPERR_A::NOERROR, true => WRPERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == WRPERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == WRPERR_A::ERROR } } #[doc = "Write protected error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WRPERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<WRPERR_AW> for bool { #[inline(always)] fn from(variant: WRPERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `WRPERR`"] pub struct WRPERR_W<'a> { w: &'a mut W, } impl<'a> WRPERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: WRPERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(WRPERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8); self.w } } #[doc = "Programming alignment error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PGAERR_A { #[doc = "0: No alignment error happened"] NOERROR = 0, #[doc = "1: One alignment error happened"] ERROR = 1, } impl From<PGAERR_A> for bool { #[inline(always)] fn from(variant: PGAERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `PGAERR`"] pub type PGAERR_R = crate::R<bool, PGAERR_A>; impl PGAERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PGAERR_A { match self.bits { false => PGAERR_A::NOERROR, true => PGAERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == PGAERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == PGAERR_A::ERROR } } #[doc = "Programming alignment error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PGAERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<PGAERR_AW> for bool { #[inline(always)] fn from(variant: PGAERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `PGAERR`"] pub struct PGAERR_W<'a> { w: &'a mut W, } impl<'a> PGAERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PGAERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(PGAERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9); self.w } } #[doc = "Size error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SIZERR_A { #[doc = "0: No size error happened"] NOERROR = 0, #[doc = "1: One size error happened"] ERROR = 1, } impl From<SIZERR_A> for bool { #[inline(always)] fn from(variant: SIZERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `SIZERR`"] pub type SIZERR_R = crate::R<bool, SIZERR_A>; impl SIZERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SIZERR_A { match self.bits { false => SIZERR_A::NOERROR, true => SIZERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == SIZERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == SIZERR_A::ERROR } } #[doc = "Size error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SIZERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<SIZERR_AW> for bool { #[inline(always)] fn from(variant: SIZERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `SIZERR`"] pub struct SIZERR_W<'a> { w: &'a mut W, } impl<'a> SIZERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SIZERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(SIZERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10); self.w } } #[doc = "Option validity error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OPTVERR_A { #[doc = "0: No error happened during the Option bytes loading"] NOERROR = 0, #[doc = "1: One or more errors happened during the Option bytes loading"] ERROR = 1, } impl From<OPTVERR_A> for bool { #[inline(always)] fn from(variant: OPTVERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `OPTVERR`"] pub type OPTVERR_R = crate::R<bool, OPTVERR_A>; impl OPTVERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> OPTVERR_A { match self.bits { false => OPTVERR_A::NOERROR, true => OPTVERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == OPTVERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == OPTVERR_A::ERROR } } #[doc = "Option validity error\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum OPTVERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<OPTVERR_AW> for bool { #[inline(always)] fn from(variant: OPTVERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `OPTVERR`"] pub struct OPTVERR_W<'a> { w: &'a mut W, } impl<'a> OPTVERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: OPTVERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(OPTVERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11); self.w } } #[doc = "RDERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RDERR_A { #[doc = "0: No read protection error happened."] NOERROR = 0, #[doc = "1: One read protection error happened"] ERROR = 1, } impl From<RDERR_A> for bool { #[inline(always)] fn from(variant: RDERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `RDERR`"] pub type RDERR_R = crate::R<bool, RDERR_A>; impl RDERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> RDERR_A { match self.bits { false => RDERR_A::NOERROR, true => RDERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == RDERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == RDERR_A::ERROR } } #[doc = "RDERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RDERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<RDERR_AW> for bool { #[inline(always)] fn from(variant: RDERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `RDERR`"] pub struct RDERR_W<'a> { w: &'a mut W, } impl<'a> RDERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: RDERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(RDERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14); self.w } } #[doc = "NOTZEROERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum NOTZEROERR_A { #[doc = "0: The write operation is done in an erased region or the memory interface can apply an erase before a write"] NOEVENT = 0, #[doc = "1: The write operation is attempting to write to a not-erased region and the memory interface cannot apply an erase before a write"] EVENT = 1, } impl From<NOTZEROERR_A> for bool { #[inline(always)] fn from(variant: NOTZEROERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `NOTZEROERR`"] pub type NOTZEROERR_R = crate::R<bool, NOTZEROERR_A>; impl NOTZEROERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> NOTZEROERR_A { match self.bits { false => NOTZEROERR_A::NOEVENT, true => NOTZEROERR_A::EVENT, } } #[doc = "Checks if the value of the field is `NOEVENT`"] #[inline(always)] pub fn is_no_event(&self) -> bool { *self == NOTZEROERR_A::NOEVENT } #[doc = "Checks if the value of the field is `EVENT`"] #[inline(always)] pub fn is_event(&self) -> bool { *self == NOTZEROERR_A::EVENT } } #[doc = "NOTZEROERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum NOTZEROERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<NOTZEROERR_AW> for bool { #[inline(always)] fn from(variant: NOTZEROERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `NOTZEROERR`"] pub struct NOTZEROERR_W<'a> { w: &'a mut W, } impl<'a> NOTZEROERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: NOTZEROERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(NOTZEROERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16); self.w } } #[doc = "FWWERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FWWERR_A { #[doc = "0: No write/erase operation aborted to perform a fetch"] NOERROR = 0, #[doc = "1: A write/erase operation aborted to perform a fetch"] ERROR = 1, } impl From<FWWERR_A> for bool { #[inline(always)] fn from(variant: FWWERR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `FWWERR`"] pub type FWWERR_R = crate::R<bool, FWWERR_A>; impl FWWERR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FWWERR_A { match self.bits { false => FWWERR_A::NOERROR, true => FWWERR_A::ERROR, } } #[doc = "Checks if the value of the field is `NOERROR`"] #[inline(always)] pub fn is_no_error(&self) -> bool { *self == FWWERR_A::NOERROR } #[doc = "Checks if the value of the field is `ERROR`"] #[inline(always)] pub fn is_error(&self) -> bool { *self == FWWERR_A::ERROR } } #[doc = "FWWERR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FWWERR_AW { #[doc = "1: Clear the flag"] CLEAR = 1, } impl From<FWWERR_AW> for bool { #[inline(always)] fn from(variant: FWWERR_AW) -> Self { variant as u8 != 0 } } #[doc = "Write proxy for field `FWWERR`"] pub struct FWWERR_W<'a> { w: &'a mut W, } impl<'a> FWWERR_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FWWERR_AW) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Clear the flag"] #[inline(always)] pub fn clear(self) -> &'a mut W { self.variant(FWWERR_AW::CLEAR) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17); self.w } } impl R { #[doc = "Bit 0 - Write/erase operations in progress"] #[inline(always)] pub fn bsy(&self) -> BSY_R { BSY_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - End of operation"] #[inline(always)] pub fn eop(&self) -> EOP_R { EOP_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - End of high voltage"] #[inline(always)] pub fn endhv(&self) -> ENDHV_R { ENDHV_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - Flash memory module ready after low power mode"] #[inline(always)] pub fn ready(&self) -> READY_R { READY_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 8 - Write protected error"] #[inline(always)] pub fn wrperr(&self) -> WRPERR_R { WRPERR_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 9 - Programming alignment error"] #[inline(always)] pub fn pgaerr(&self) -> PGAERR_R { PGAERR_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 10 - Size error"] #[inline(always)] pub fn sizerr(&self) -> SIZERR_R { SIZERR_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 11 - Option validity error"] #[inline(always)] pub fn optverr(&self) -> OPTVERR_R { OPTVERR_R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bit 14 - RDERR"] #[inline(always)] pub fn rderr(&self) -> RDERR_R { RDERR_R::new(((self.bits >> 14) & 0x01) != 0) } #[doc = "Bit 16 - NOTZEROERR"] #[inline(always)] pub fn notzeroerr(&self) -> NOTZEROERR_R { NOTZEROERR_R::new(((self.bits >> 16) & 0x01) != 0) } #[doc = "Bit 17 - FWWERR"] #[inline(always)] pub fn fwwerr(&self) -> FWWERR_R { FWWERR_R::new(((self.bits >> 17) & 0x01) != 0) } } impl W { #[doc = "Bit 1 - End of operation"] #[inline(always)] pub fn eop(&mut self) -> EOP_W { EOP_W { w: self } } #[doc = "Bit 8 - Write protected error"] #[inline(always)] pub fn wrperr(&mut self) -> WRPERR_W { WRPERR_W { w: self } } #[doc = "Bit 9 - Programming alignment error"] #[inline(always)] pub fn pgaerr(&mut self) -> PGAERR_W { PGAERR_W { w: self } } #[doc = "Bit 10 - Size error"] #[inline(always)] pub fn sizerr(&mut self) -> SIZERR_W { SIZERR_W { w: self } } #[doc = "Bit 11 - Option validity error"] #[inline(always)] pub fn optverr(&mut self) -> OPTVERR_W { OPTVERR_W { w: self } } #[doc = "Bit 14 - RDERR"] #[inline(always)] pub fn rderr(&mut self) -> RDERR_W { RDERR_W { w: self } } #[doc = "Bit 16 - NOTZEROERR"] #[inline(always)] pub fn notzeroerr(&mut self) -> NOTZEROERR_W { NOTZEROERR_W { w: self } } #[doc = "Bit 17 - FWWERR"] #[inline(always)] pub fn fwwerr(&mut self) -> FWWERR_W { FWWERR_W { w: self } } }
pub mod exc { pub trait Exercise { fn run(&self); // fn run_self<T: Self>(&self){ // T::run(); // } } }
//! Hexagonal grids with overlaid coordinate systems. pub mod shape; pub mod coords; pub use coords::*; use crate::geo::*; use crate::grid::shape::Shape; use nalgebra::core::Vector2; use nalgebra::geometry::Point2; use std::collections::HashMap; /// A grid is a contiguous arrangement of hexagonal tiles with /// an overlaid coordinate system. #[derive(Clone, Debug)] pub struct Grid<C: Coords> { schema: Schema, store: HashMap<C, Hexagon>, // TODO: Configurable spatial hashing. dimensions: Dimensions, } #[derive(Clone, Debug)] pub struct Dimensions { pub width: f32, pub height: f32, pub pixel_offset: Vector2<f32> } impl<C: Coords> Grid<C> { /// Constructs a new grid whose tiles conform to the given schema. pub fn new<I>(schema: Schema, shape: Shape<I>) -> Grid<C> where I: IntoIterator<Item=Cube> { let num_hexagons = shape.total; let (ps, cs): (Vec<Point2<f32>>, Vec<C>) = shape.into_iter().map(|c| (c.to_pixel(&schema), C::from(c))).unzip(); let dimensions = Self::measure(&schema, &ps); let offset = dimensions.pixel_offset; let store = { let mut store = HashMap::with_capacity(num_hexagons); let hexagons = ps.iter().map(|c| schema.hexagon(c + offset)); store.extend(cs.into_iter().zip(hexagons)); store }; Grid { schema, store, dimensions, } } /// Measures the dimensions of a grid, given the schema for the tiles and /// the coordinates of the tile centers. fn measure(schema: &Schema, centers: &Vec<Point2<f32>>) -> Dimensions { let min_max = (Point2::origin(), Point2::origin()); let (min, max) = centers.iter().fold(min_max, |(min, max), c| { let new_min_x = f32::min(min.x, c.x); let new_max_x = f32::max(max.x, c.x); let new_min_y = f32::min(min.y, c.y); let new_max_y = f32::max(max.y, c.y); let new_min = Point2::new(new_min_x, new_min_y); let new_max = Point2::new(new_max_x, new_max_y); (new_min, new_max) }); let offset_x = (min.x - schema.width / 2.).abs(); let offset_y = (min.y - schema.height / 2.).abs(); Dimensions { width: max.x - min.x + schema.width, height: max.y - min.y + schema.height, pixel_offset: Vector2::new(offset_x, offset_y), } } pub fn schema(&self) -> &Schema { &self.schema } pub fn from_pixel(&self, p: Point2<f32>) -> Option<(C, &Hexagon)> { let offset = self.dimensions.pixel_offset; let c = C::from(Cube::from_pixel(p - offset, &self.schema)); self.store.get(&c).map(|h| (c, h)) } pub fn to_pixel(&self, c: C) -> Point2<f32> { let offset = self.dimensions.pixel_offset; c.into().to_pixel(&self.schema) + offset } pub fn get(&self, c: C) -> Option<&Hexagon> { self.store.get(&c) } pub fn iter(&self) -> impl Iterator<Item=(&C, &Hexagon)> + '_ { self.store.iter() } pub fn iter_within<'a>(&'a self, b: &'a Bounds) -> impl Iterator<Item=(&C, &Hexagon)> + 'a { self.iter().filter( move |(_, hex)| b.intersects(&self.schema.bounds(&hex))) } pub fn dimensions(&self) -> &Dimensions { &self.dimensions } } #[cfg(test)] mod tests { use super::*; use quickcheck::*; impl<C: Coords + Send + 'static> Arbitrary for Grid<C> { fn arbitrary<G: Gen>(g: &mut G) -> Grid<C> { let size = SideLength::arbitrary(g); let schema = Schema::new(size, Orientation::arbitrary(g)); let shape = Shape::<Vec<Cube>>::arbitrary(g); Grid::new(schema, shape) } } #[test] fn prop_new_grid() { fn prop(g: Grid<Cube>) -> bool { g.iter().all(|(c, h)| { let b = Bounds { position: Point2::origin(), width: g.dimensions.width, height: g.dimensions.height }; g.schema().bounds(&h).inner().within(&b.outer()) && g.from_pixel(h.center).is_some() && g.from_pixel(g.to_pixel(*c)) == Some((*c, h)) }) } quickcheck(prop as fn(_) -> _); } }
use crate::context::RpcContext; use crate::v02::types::ContractClass; use anyhow::Context; use pathfinder_common::{BlockId, ClassHash, ContractAddress}; use starknet_gateway_types::pending::PendingData; crate::error::generate_rpc_error_subset!(GetClassAtError: BlockNotFound, ContractNotFound); #[derive(serde::Deserialize, Debug, PartialEq, Eq)] pub struct GetClassAtInput { block_id: BlockId, contract_address: ContractAddress, } pub async fn get_class_at( context: RpcContext, input: GetClassAtInput, ) -> Result<ContractClass, GetClassAtError> { let span = tracing::Span::current(); // Map block id to the storage variant. let block_id = match input.block_id { BlockId::Pending => pathfinder_storage::BlockId::Latest, other => other.try_into().expect("Only pending cast should fail"), }; let pending_class_hash = if input.block_id == BlockId::Pending { get_pending_class_hash(context.pending_data, input.contract_address).await } else { None }; let jh = tokio::task::spawn_blocking(move || { let _g = span.enter(); let mut db = context .storage .connection() .context("Opening database connection")?; let tx = db.transaction().context("Creating database transaction")?; if !tx.block_exists(block_id)? { return Err(GetClassAtError::BlockNotFound); } let class_hash = match pending_class_hash { Some(class_hash) => class_hash, None => tx .contract_class_hash(block_id, input.contract_address) .context("Querying contract's class hash")? .ok_or(GetClassAtError::ContractNotFound)?, }; let definition = tx .class_definition(class_hash) .context("Fetching class definition")? .context("Class definition missing from database")?; let class = ContractClass::from_definition_bytes(&definition) .context("Parsing class definition")?; Ok(class) }); jh.await.context("Reading class from database")? } /// Returns the [ClassHash] of the given [ContractAddress] if any is defined in the pending data. async fn get_pending_class_hash( pending: Option<PendingData>, address: ContractAddress, ) -> Option<ClassHash> { pending?.state_update().await.and_then(|state_update| { state_update .contract_updates .get(&address) .and_then(|x| x.class.as_ref().map(|x| x.class_hash())) }) } #[cfg(test)] mod tests { use super::*; use assert_matches::assert_matches; use pathfinder_common::macro_prelude::*; mod parsing { use super::*; use jsonrpsee::types::Params; #[test] fn positional_args() { let positional = r#"[ { "block_hash": "0xabcde" }, "0x12345" ]"#; let positional = Params::new(Some(positional)); let input = positional.parse::<GetClassAtInput>().unwrap(); let expected = GetClassAtInput { block_id: block_hash!("0xabcde").into(), contract_address: contract_address!("0x12345"), }; assert_eq!(input, expected); } #[test] fn named_args() { let named = r#"{ "block_id": { "block_hash": "0xabcde" }, "contract_address": "0x12345" }"#; let named = Params::new(Some(named)); let input = named.parse::<GetClassAtInput>().unwrap(); let expected = GetClassAtInput { block_id: block_hash!("0xabcde").into(), contract_address: contract_address!("0x12345"), }; assert_eq!(input, expected); } } #[tokio::test] async fn pending() { let context = RpcContext::for_tests(); // Cairo class v0.x let valid_v0 = contract_address_bytes!(b"contract 0"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Pending, contract_address: valid_v0, }, ) .await .unwrap(); // Cairo class v1.x let valid_v1 = contract_address_bytes!(b"contract 2 (sierra)"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Pending, contract_address: valid_v1, }, ) .await .unwrap(); let invalid = contract_address_bytes!(b"invalid"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Pending, contract_address: invalid, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); } #[tokio::test] async fn latest() { let context = RpcContext::for_tests(); // Cairo class v0.x let valid_v0 = contract_address_bytes!(b"contract 0"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Latest, contract_address: valid_v0, }, ) .await .unwrap(); // Cairo class v1.x let valid_v1 = contract_address_bytes!(b"contract 2 (sierra)"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Latest, contract_address: valid_v1, }, ) .await .unwrap(); let invalid = contract_address_bytes!(b"invalid"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Latest, contract_address: invalid, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); } #[tokio::test] async fn number() { use pathfinder_common::BlockNumber; let context = RpcContext::for_tests(); // Cairo v0.x class // This contract is declared in block 1. let valid_v0 = contract_address_bytes!(b"contract 1"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Number(BlockNumber::new_or_panic(1)), contract_address: valid_v0, }, ) .await .unwrap(); // Cairo v1.x class (sierra) // This contract is declared in block 2. let valid_v1 = contract_address_bytes!(b"contract 2 (sierra)"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Number(BlockNumber::new_or_panic(2)), contract_address: valid_v1, }, ) .await .unwrap(); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Number(BlockNumber::GENESIS), contract_address: valid_v0, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); let invalid = contract_address_bytes!(b"invalid"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Number(BlockNumber::new_or_panic(2)), contract_address: invalid, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); // Class exists, but block number does not. let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Number(BlockNumber::MAX), contract_address: valid_v0, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::BlockNotFound); } #[tokio::test] async fn hash() { let context = RpcContext::for_tests(); // Cairo v0.x class // This class is declared in block 1. let valid_v0 = contract_address_bytes!(b"contract 1"); let block1_hash = block_hash_bytes!(b"block 1"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Hash(block1_hash), contract_address: valid_v0, }, ) .await .unwrap(); // Cairo v1.x class (sierra) // This class is declared in block 2. let valid_v1 = contract_address_bytes!(b"contract 2 (sierra)"); let block2_hash = block_hash_bytes!(b"latest"); super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Hash(block2_hash), contract_address: valid_v1, }, ) .await .unwrap(); let block0_hash = block_hash_bytes!(b"genesis"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Hash(block0_hash), contract_address: valid_v0, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); let invalid = contract_address_bytes!(b"invalid"); let latest_hash = block_hash_bytes!(b"latest"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Hash(latest_hash), contract_address: invalid, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::ContractNotFound); // Class exists, but block hash does not. let invalid_block = block_hash_bytes!(b"invalid"); let error = super::get_class_at( context.clone(), GetClassAtInput { block_id: BlockId::Hash(invalid_block), contract_address: valid_v0, }, ) .await .unwrap_err(); assert_matches!(error, GetClassAtError::BlockNotFound); } }
use std::any::TypeId; /// An Enum with a variant for every Event that can be sent to a remote host pub trait EventType: Clone { // write & get_type_id are ONLY currently used for reading/writing auth events.. // maybe should do something different here /// Writes the typed Event into an outgoing byte stream fn write(&self, buffer: &mut Vec<u8>); /// Get the TypeId of the contained Event fn get_type_id(&self) -> TypeId; }
//! Korat provides rusoto implementations for using an structs as dynamodb items #[macro_use] extern crate quote; extern crate proc_macro; extern crate syn; mod dynamodb_item; use proc_macro::TokenStream; use dynamodb_item::expand; #[proc_macro_derive(DynamoDBItem, attributes(hash, range))] pub fn dynamodb_item(input: TokenStream) -> TokenStream { let s = input.to_string(); let ast = syn::parse_macro_input(&s).unwrap(); let gen = expand(&ast); gen.parse().unwrap() }
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. pub fn parse_http_generic_error( response: &http::Response<bytes::Bytes>, ) -> Result<smithy_types::Error, smithy_json::deserialize::Error> { crate::json_errors::parse_generic_error(response.body(), response.headers()) } pub fn deser_structure_internal_server_exceptionjson_err( input: &[u8], mut builder: crate::error::internal_server_exception::Builder, ) -> Result<crate::error::internal_server_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_invalid_request_exceptionjson_err( input: &[u8], mut builder: crate::error::invalid_request_exception::Builder, ) -> Result<crate::error::invalid_request_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_resource_not_found_exceptionjson_err( input: &[u8], mut builder: crate::error::resource_not_found_exception::Builder, ) -> Result<crate::error::resource_not_found_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_too_many_requests_exceptionjson_err( input: &[u8], mut builder: crate::error::too_many_requests_exception::Builder, ) -> Result<crate::error::too_many_requests_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_describe_entities_detection_v2_job( input: &[u8], mut builder: crate::output::describe_entities_detection_v2_job_output::Builder, ) -> Result< crate::output::describe_entities_detection_v2_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobProperties" => { builder = builder.set_comprehend_medical_async_job_properties( crate::json_deser::deser_structure_comprehend_medical_async_job_properties(tokens)? ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_describe_icd10_cm_inference_job( input: &[u8], mut builder: crate::output::describe_icd10_cm_inference_job_output::Builder, ) -> Result< crate::output::describe_icd10_cm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobProperties" => { builder = builder.set_comprehend_medical_async_job_properties( crate::json_deser::deser_structure_comprehend_medical_async_job_properties(tokens)? ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_describe_phi_detection_job( input: &[u8], mut builder: crate::output::describe_phi_detection_job_output::Builder, ) -> Result< crate::output::describe_phi_detection_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobProperties" => { builder = builder.set_comprehend_medical_async_job_properties( crate::json_deser::deser_structure_comprehend_medical_async_job_properties(tokens)? ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_describe_rx_norm_inference_job( input: &[u8], mut builder: crate::output::describe_rx_norm_inference_job_output::Builder, ) -> Result< crate::output::describe_rx_norm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobProperties" => { builder = builder.set_comprehend_medical_async_job_properties( crate::json_deser::deser_structure_comprehend_medical_async_job_properties(tokens)? ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_invalid_encoding_exceptionjson_err( input: &[u8], mut builder: crate::error::invalid_encoding_exception::Builder, ) -> Result<crate::error::invalid_encoding_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_service_unavailable_exceptionjson_err( input: &[u8], mut builder: crate::error::service_unavailable_exception::Builder, ) -> Result<crate::error::service_unavailable_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_text_size_limit_exceeded_exceptionjson_err( input: &[u8], mut builder: crate::error::text_size_limit_exceeded_exception::Builder, ) -> Result< crate::error::text_size_limit_exceeded_exception::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_detect_entities( input: &[u8], mut builder: crate::output::detect_entities_output::Builder, ) -> Result<crate::output::detect_entities_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Entities" => { builder = builder .set_entities(crate::json_deser::deser_list_entity_list(tokens)?); } "UnmappedAttributes" => { builder = builder.set_unmapped_attributes( crate::json_deser::deser_list_unmapped_attribute_list(tokens)?, ); } "PaginationToken" => { builder = builder.set_pagination_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_detect_entities_v2( input: &[u8], mut builder: crate::output::detect_entities_v2_output::Builder, ) -> Result<crate::output::detect_entities_v2_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Entities" => { builder = builder .set_entities(crate::json_deser::deser_list_entity_list(tokens)?); } "UnmappedAttributes" => { builder = builder.set_unmapped_attributes( crate::json_deser::deser_list_unmapped_attribute_list(tokens)?, ); } "PaginationToken" => { builder = builder.set_pagination_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_detect_phi( input: &[u8], mut builder: crate::output::detect_phi_output::Builder, ) -> Result<crate::output::detect_phi_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Entities" => { builder = builder .set_entities(crate::json_deser::deser_list_entity_list(tokens)?); } "PaginationToken" => { builder = builder.set_pagination_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_infer_icd10_cm( input: &[u8], mut builder: crate::output::infer_icd10_cm_output::Builder, ) -> Result<crate::output::infer_icd10_cm_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Entities" => { builder = builder.set_entities( crate::json_deser::deser_list_icd10_cm_entity_list(tokens)?, ); } "PaginationToken" => { builder = builder.set_pagination_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_infer_rx_norm( input: &[u8], mut builder: crate::output::infer_rx_norm_output::Builder, ) -> Result<crate::output::infer_rx_norm_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Entities" => { builder = builder.set_entities( crate::json_deser::deser_list_rx_norm_entity_list(tokens)?, ); } "PaginationToken" => { builder = builder.set_pagination_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_structure_validation_exceptionjson_err( input: &[u8], mut builder: crate::error::validation_exception::Builder, ) -> Result<crate::error::validation_exception::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_list_entities_detection_v2_jobs( input: &[u8], mut builder: crate::output::list_entities_detection_v2_jobs_output::Builder, ) -> Result< crate::output::list_entities_detection_v2_jobs_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobPropertiesList" => { builder = builder.set_comprehend_medical_async_job_properties_list( crate::json_deser::deser_list_comprehend_medical_async_job_properties_list(tokens)? ); } "NextToken" => { builder = builder.set_next_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_list_icd10_cm_inference_jobs( input: &[u8], mut builder: crate::output::list_icd10_cm_inference_jobs_output::Builder, ) -> Result< crate::output::list_icd10_cm_inference_jobs_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobPropertiesList" => { builder = builder.set_comprehend_medical_async_job_properties_list( crate::json_deser::deser_list_comprehend_medical_async_job_properties_list(tokens)? ); } "NextToken" => { builder = builder.set_next_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_list_phi_detection_jobs( input: &[u8], mut builder: crate::output::list_phi_detection_jobs_output::Builder, ) -> Result<crate::output::list_phi_detection_jobs_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobPropertiesList" => { builder = builder.set_comprehend_medical_async_job_properties_list( crate::json_deser::deser_list_comprehend_medical_async_job_properties_list(tokens)? ); } "NextToken" => { builder = builder.set_next_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_list_rx_norm_inference_jobs( input: &[u8], mut builder: crate::output::list_rx_norm_inference_jobs_output::Builder, ) -> Result< crate::output::list_rx_norm_inference_jobs_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "ComprehendMedicalAsyncJobPropertiesList" => { builder = builder.set_comprehend_medical_async_job_properties_list( crate::json_deser::deser_list_comprehend_medical_async_job_properties_list(tokens)? ); } "NextToken" => { builder = builder.set_next_token( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_start_entities_detection_v2_job( input: &[u8], mut builder: crate::output::start_entities_detection_v2_job_output::Builder, ) -> Result< crate::output::start_entities_detection_v2_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_start_icd10_cm_inference_job( input: &[u8], mut builder: crate::output::start_icd10_cm_inference_job_output::Builder, ) -> Result< crate::output::start_icd10_cm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_start_phi_detection_job( input: &[u8], mut builder: crate::output::start_phi_detection_job_output::Builder, ) -> Result<crate::output::start_phi_detection_job_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_start_rx_norm_inference_job( input: &[u8], mut builder: crate::output::start_rx_norm_inference_job_output::Builder, ) -> Result< crate::output::start_rx_norm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_stop_entities_detection_v2_job( input: &[u8], mut builder: crate::output::stop_entities_detection_v2_job_output::Builder, ) -> Result< crate::output::stop_entities_detection_v2_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_stop_icd10_cm_inference_job( input: &[u8], mut builder: crate::output::stop_icd10_cm_inference_job_output::Builder, ) -> Result< crate::output::stop_icd10_cm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_stop_phi_detection_job( input: &[u8], mut builder: crate::output::stop_phi_detection_job_output::Builder, ) -> Result<crate::output::stop_phi_detection_job_output::Builder, smithy_json::deserialize::Error> { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn deser_operation_stop_rx_norm_inference_job( input: &[u8], mut builder: crate::output::stop_rx_norm_inference_job_output::Builder, ) -> Result< crate::output::stop_rx_norm_inference_job_output::Builder, smithy_json::deserialize::Error, > { let mut tokens_owned = smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(input)) .peekable(); let tokens = &mut tokens_owned; smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null(tokens.next())? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } if tokens.next().is_some() { return Err(smithy_json::deserialize::Error::custom( "found more JSON tokens after completing parsing", )); } Ok(builder) } pub fn or_empty_doc(data: &[u8]) -> &[u8] { if data.is_empty() { b"{}" } else { data } } pub fn deser_structure_comprehend_medical_async_job_properties<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<crate::model::ComprehendMedicalAsyncJobProperties>, smithy_json::deserialize::Error, > where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::ComprehendMedicalAsyncJobProperties::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "JobId" => { builder = builder.set_job_id( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "JobName" => { builder = builder.set_job_name( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "JobStatus" => { builder = builder.set_job_status( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::JobStatus::from(u.as_ref())) }) .transpose()?, ); } "Message" => { builder = builder.set_message( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "SubmitTime" => { builder = builder.set_submit_time( smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), smithy_types::instant::Format::EpochSeconds, )?, ); } "EndTime" => { builder = builder.set_end_time( smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), smithy_types::instant::Format::EpochSeconds, )?, ); } "ExpirationTime" => { builder = builder.set_expiration_time( smithy_json::deserialize::token::expect_timestamp_or_null( tokens.next(), smithy_types::instant::Format::EpochSeconds, )?, ); } "InputDataConfig" => { builder = builder.set_input_data_config( crate::json_deser::deser_structure_input_data_config(tokens)?, ); } "OutputDataConfig" => { builder = builder.set_output_data_config( crate::json_deser::deser_structure_output_data_config(tokens)?, ); } "LanguageCode" => { builder = builder.set_language_code( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::LanguageCode::from(u.as_ref())) }) .transpose()?, ); } "DataAccessRoleArn" => { builder = builder.set_data_access_role_arn( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ManifestFilePath" => { builder = builder.set_manifest_file_path( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "KMSKey" => { builder = builder.set_kms_key( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "ModelVersion" => { builder = builder.set_model_version( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_entity_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Entity>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_entity(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_unmapped_attribute_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::UnmappedAttribute>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_unmapped_attribute(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_icd10_cm_entity_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Icd10CmEntity>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_icd10_cm_entity(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_rx_norm_entity_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::RxNormEntity>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_rx_norm_entity(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_comprehend_medical_async_job_properties_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result< Option<std::vec::Vec<crate::model::ComprehendMedicalAsyncJobProperties>>, smithy_json::deserialize::Error, > where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_comprehend_medical_async_job_properties(tokens)? ; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_input_data_config<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::InputDataConfig>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::InputDataConfig::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "S3Bucket" => { builder = builder.set_s3_bucket( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "S3Key" => { builder = builder.set_s3_key( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_output_data_config<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::OutputDataConfig>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::OutputDataConfig::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "S3Bucket" => { builder = builder.set_s3_bucket( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "S3Key" => { builder = builder.set_s3_key( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_entity<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Entity>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Entity::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Category" => { builder = builder.set_category( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::EntityType::from(u.as_ref())) }) .transpose()?, ); } "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::EntitySubType::from(u.as_ref())) }) .transpose()?, ); } "Traits" => { builder = builder .set_traits(crate::json_deser::deser_list_trait_list(tokens)?); } "Attributes" => { builder = builder.set_attributes( crate::json_deser::deser_list_attribute_list(tokens)?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_unmapped_attribute<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::UnmappedAttribute>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::UnmappedAttribute::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::EntityType::from(u.as_ref())) }) .transpose()?, ); } "Attribute" => { builder = builder.set_attribute( crate::json_deser::deser_structure_attribute(tokens)?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_icd10_cm_entity<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Icd10CmEntity>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Icd10CmEntity::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Category" => { builder = builder.set_category( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmEntityCategory::from(u.as_ref()) }) }) .transpose()?, ); } "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmEntityType::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Attributes" => { builder = builder.set_attributes( crate::json_deser::deser_list_icd10_cm_attribute_list(tokens)?, ); } "Traits" => { builder = builder.set_traits( crate::json_deser::deser_list_icd10_cm_trait_list(tokens)?, ); } "ICD10CMConcepts" => { builder = builder.set_icd10_cm_concepts( crate::json_deser::deser_list_icd10_cm_concept_list(tokens)?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_rx_norm_entity<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RxNormEntity>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RxNormEntity::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Category" => { builder = builder.set_category( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RxNormEntityCategory::from(u.as_ref()) }) }) .transpose()?, ); } "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RxNormEntityType::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Attributes" => { builder = builder.set_attributes( crate::json_deser::deser_list_rx_norm_attribute_list(tokens)?, ); } "Traits" => { builder = builder.set_traits( crate::json_deser::deser_list_rx_norm_trait_list(tokens)?, ); } "RxNormConcepts" => { builder = builder.set_rx_norm_concepts( crate::json_deser::deser_list_rx_norm_concept_list(tokens)?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_trait_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Trait>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_trait(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_attribute_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Attribute>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_attribute(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_attribute<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Attribute>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Attribute::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::EntitySubType::from(u.as_ref())) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "RelationshipScore" => { builder = builder.set_relationship_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "RelationshipType" => { builder = builder.set_relationship_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RelationshipType::from(u.as_ref()) }) }) .transpose()?, ); } "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Category" => { builder = builder.set_category( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::EntityType::from(u.as_ref())) }) .transpose()?, ); } "Traits" => { builder = builder .set_traits(crate::json_deser::deser_list_trait_list(tokens)?); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_icd10_cm_attribute_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Icd10CmAttribute>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_icd10_cm_attribute(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_icd10_cm_trait_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Icd10CmTrait>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_icd10_cm_trait(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_icd10_cm_concept_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::Icd10CmConcept>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_icd10_cm_concept(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_rx_norm_attribute_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::RxNormAttribute>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_rx_norm_attribute(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_rx_norm_trait_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::RxNormTrait>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_rx_norm_trait(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } #[allow(clippy::type_complexity, non_snake_case)] pub fn deser_list_rx_norm_concept_list<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<std::vec::Vec<crate::model::RxNormConcept>>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartArray { .. }) => { let mut items = Vec::new(); loop { match tokens.peek() { Some(Ok(smithy_json::deserialize::Token::EndArray { .. })) => { tokens.next().transpose().unwrap(); break; } _ => { let value = crate::json_deser::deser_structure_rx_norm_concept(tokens)?; if let Some(value) = value { items.push(value); } } } } Ok(Some(items)) } _ => Err(smithy_json::deserialize::Error::custom( "expected start array or null", )), } } pub fn deser_structure_trait<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Trait>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Trait::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Name" => { builder = builder.set_name( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped() .map(|u| crate::model::AttributeName::from(u.as_ref())) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_icd10_cm_attribute<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Icd10CmAttribute>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Icd10CmAttribute::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmAttributeType::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "RelationshipScore" => { builder = builder.set_relationship_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Traits" => { builder = builder.set_traits( crate::json_deser::deser_list_icd10_cm_trait_list(tokens)?, ); } "Category" => { builder = builder.set_category( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmEntityType::from(u.as_ref()) }) }) .transpose()?, ); } "RelationshipType" => { builder = builder.set_relationship_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmRelationshipType::from(u.as_ref()) }) }) .transpose()?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_icd10_cm_trait<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Icd10CmTrait>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Icd10CmTrait::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Name" => { builder = builder.set_name( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::Icd10CmTraitName::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_icd10_cm_concept<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::Icd10CmConcept>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::Icd10CmConcept::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Description" => { builder = builder.set_description( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Code" => { builder = builder.set_code( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_rx_norm_attribute<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RxNormAttribute>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RxNormAttribute::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Type" => { builder = builder.set_type( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RxNormAttributeType::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "RelationshipScore" => { builder = builder.set_relationship_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } "Id" => { builder = builder.set_id( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "BeginOffset" => { builder = builder.set_begin_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "EndOffset" => { builder = builder.set_end_offset( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_i32()), ); } "Text" => { builder = builder.set_text( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Traits" => { builder = builder.set_traits( crate::json_deser::deser_list_rx_norm_trait_list(tokens)?, ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_rx_norm_trait<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RxNormTrait>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RxNormTrait::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Name" => { builder = builder.set_name( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| { s.to_unescaped().map(|u| { crate::model::RxNormTraitName::from(u.as_ref()) }) }) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } } pub fn deser_structure_rx_norm_concept<'a, I>( tokens: &mut std::iter::Peekable<I>, ) -> Result<Option<crate::model::RxNormConcept>, smithy_json::deserialize::Error> where I: Iterator< Item = Result<smithy_json::deserialize::Token<'a>, smithy_json::deserialize::Error>, >, { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(smithy_json::deserialize::Token::StartObject { .. }) => { #[allow(unused_mut)] let mut builder = crate::model::RxNormConcept::builder(); loop { match tokens.next().transpose()? { Some(smithy_json::deserialize::Token::EndObject { .. }) => break, Some(smithy_json::deserialize::Token::ObjectKey { key, .. }) => { match key.to_unescaped()?.as_ref() { "Description" => { builder = builder.set_description( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Code" => { builder = builder.set_code( smithy_json::deserialize::token::expect_string_or_null( tokens.next(), )? .map(|s| s.to_unescaped().map(|u| u.into_owned())) .transpose()?, ); } "Score" => { builder = builder.set_score( smithy_json::deserialize::token::expect_number_or_null( tokens.next(), )? .map(|v| v.to_f32()), ); } _ => smithy_json::deserialize::token::skip_value(tokens)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some(builder.build())) } _ => Err(smithy_json::deserialize::Error::custom( "expected start object or null", )), } }
use chrono::{DateTime, Utc}; use futures_util::StreamExt; use graphql_ws::{raw::ClientPayload, GraphQLWebSocket, Request}; // https://github.com/serde-rs/serde/issues/994 mod json_string { use serde::de::{self, Deserialize, DeserializeOwned, Deserializer}; use serde_json; pub fn deserialize<'de, T, D>(deserializer: D) -> Result<T, D::Error> where T: DeserializeOwned, D: Deserializer<'de>, { let j = String::deserialize(deserializer)?; serde_json::from_str(&j).map_err(de::Error::custom) } } #[derive(Debug, serde::Deserialize)] #[serde(rename_all = "camelCase")] struct DeviceMessage { characteristic_id: u16, #[serde(with = "json_string")] payload: serde_json::Value, timestamp: DateTime<Utc>, } #[derive(Debug, serde::Deserialize)] #[serde(rename_all = "camelCase")] struct SubResponse { device_messages: DeviceMessage, } #[tokio::main] async fn main() { tracing_subscriber::fmt::init(); let req = Request::builder() .uri("ws://localhost:8000/subscriptions") .header( "Sec-WebSocket-Protocol", "elevate-bearer_eb64a6f0-9656-404d-a4c6-2e1fd1885e97,graphql-ws", ) .body(()) .unwrap(); let mut socket = GraphQLWebSocket::connect(req).await.unwrap(); let sub = socket.subscribe::<SubResponse>(ClientPayload { query: "subscription { deviceMessages(deviceId:\"b7c15f4d-1a20-4ee6-a4d4-f28c425f8b9c\") { characteristicId payload timestamp } }".into(), variables: None, operation_name: None, }); let mut stream = sub.stream(); while let Some(msg) = stream.next().await { match msg { Ok(payload) => println!("{:#?}", payload.data.unwrap().device_messages), Err(err) => println!("Error: {:?}", err), } } }
//! Utilities such as [`HashableHashSet`] and [`HashableHashMap`]. Those two in particular are useful //! because the corresponding [`HashSet`] and [`HashMap`] do not implement [`Hash`], meaning they cannot //! be used directly in models. //! //! For example, the following is rejected by the compiler: //! //! ```rust compile_fail //! # use stateright::*; //! # use std::collections::HashSet; //! # //! # struct MyModel; //! type MyState = HashSet<u64>; //! # type MyAction = String; //! impl Model for MyModel { //! type State = MyState; //! type Action = MyAction; //! fn init_states(&self) -> Vec<Self::State> { vec![MyState::new()] } //! fn actions(&self, _state: &Self::State, actions: &mut Vec<Self::Action>) {} //! fn next_state(&self, last_state: &Self::State, action: Self::Action) -> Option<Self::State> { //! None //! } //! } //! //! let checker = MyModel.checker().spawn_bfs().join(); //! ``` //! //! ```text //! error[E0277]: the trait bound `HashSet<u64>: Hash` is not satisfied //! ``` //! //! The error can be resolved by swapping [`HashSet`] with [`HashableHashSet`]: //! //! ```rust //! # use stateright::*; //! # use std::collections::HashSet; //! # use stateright::util::HashableHashSet; //! # //! # struct MyModel; //! type MyState = HashableHashSet<u64>; //! # type MyAction = String; //! # impl Model for MyModel { //! # type State = MyState; //! # type Action = MyAction; //! # fn init_states(&self) -> Vec<Self::State> { vec![MyState::new()] } //! # fn actions(&self, _state: &Self::State, actions: &mut Vec<Self::Action>) {} //! # fn next_state(&self, last_state: &Self::State, action: Self::Action) -> Option<Self::State> { //! # None //! # } //! # } //! # //! # let checker = MyModel.checker().spawn_bfs().join(); //! ``` mod densenatmap; use std::cell::RefCell; use std::cmp::Ordering; use std::collections::{hash_map::DefaultHasher, HashMap, HashSet}; use std::fmt::{self, Debug, Formatter}; use std::hash::{BuildHasher, Hash, Hasher}; use std::iter::FromIterator; use std::ops::{Deref, DerefMut}; mod vector_clock; pub use densenatmap::DenseNatMap; pub use vector_clock::*; // Reuse a buffer to avoid temporary allocations. thread_local!(static BUFFER: RefCell<Vec<u64>> = RefCell::new(Vec::with_capacity(100))); /// A [`HashSet`] wrapper that implements [`Hash`] by sorting pre-hashed entries and feeding those back /// into the passed-in [`Hasher`]. #[derive(Clone)] pub struct HashableHashSet<V, S = ahash::RandomState>(HashSet<V, S>); impl<V> HashableHashSet<V> { #[inline] pub fn new() -> HashableHashSet<V> { Default::default() } #[inline] pub fn with_capacity(capacity: usize) -> HashableHashSet<V> { HashableHashSet(HashSet::with_capacity_and_hasher(capacity, Default::default())) } } impl<V, S> HashableHashSet<V, S> { #[inline] pub fn with_hasher(hasher: S) -> Self { HashableHashSet(HashSet::with_hasher(hasher)) } #[inline] pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> Self { HashableHashSet(HashSet::with_capacity_and_hasher(capacity, hasher)) } } impl<V: Debug, S> Debug for HashableHashSet<V, S> { fn fmt(&self, f: &mut Formatter) -> fmt::Result { self.0.fmt(f) // transparent } } impl<V, S: Default> Default for HashableHashSet<V, S> { #[inline] fn default() -> HashableHashSet<V, S> { HashableHashSet::with_hasher(S::default()) } } impl<V, S> Deref for HashableHashSet<V, S> { type Target = HashSet<V, S>; fn deref(&self) -> &Self::Target { &self.0 } } impl<V, S> DerefMut for HashableHashSet<V, S> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl<V: Hash + Eq, S: BuildHasher> Eq for HashableHashSet<V, S> {} impl<V: Eq + Hash, S: BuildHasher + Default> FromIterator<V> for HashableHashSet<V, S> { fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self { HashableHashSet(HashSet::from_iter(iter)) } } impl<V: Hash, S> Hash for HashableHashSet<V, S> { fn hash<H: Hasher>(&self, hasher: &mut H) { BUFFER.with(|buffer| { // The cached buffer might already be in use farther up the call stack, so the // algorithm reverts to a fallback as needed. let fallback = RefCell::new(Vec::new()); let mut buffer = buffer .try_borrow_mut() .unwrap_or_else(|_| fallback.borrow_mut()); buffer.clear(); buffer.extend(self.0.iter().map(|v| { let mut inner_hasher = crate::stable::hasher(); v.hash(&mut inner_hasher); inner_hasher.finish() })); buffer.sort_unstable(); for v in &*buffer { hasher.write_u64(*v); } }); } } fn calculate_hash<T: Hash>(t: &T) -> u64 { let mut s = DefaultHasher::new(); t.hash(&mut s); s.finish() } impl<V: Hash + Eq, S: BuildHasher> PartialOrd for HashableHashSet<V, S> { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { calculate_hash(self).partial_cmp(&calculate_hash(other)) } } impl<V: Hash + Eq, S: BuildHasher> Ord for HashableHashSet<V, S> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { calculate_hash(self).cmp(&calculate_hash(other)) } } impl<'a, V, S> IntoIterator for &'a HashableHashSet<V, S> { type Item = &'a V; type IntoIter = std::collections::hash_set::Iter<'a, V>; #[inline] fn into_iter(self) -> std::collections::hash_set::Iter<'a, V> { self.0.iter() } } impl<V: Hash + Eq, S: BuildHasher> PartialEq for HashableHashSet<V, S> { fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } } impl<V, S> serde::Serialize for HashableHashSet<V, S> where V: Eq + Hash + serde::Serialize, S: BuildHasher, { fn serialize<Ser: serde::Serializer>(&self, ser: Ser) -> Result<Ser::Ok, Ser::Error> { self.0.serialize(ser) } } impl<'de, V, S> serde::Deserialize<'de> for HashableHashSet<V, S> where V: Eq + Hash + serde::Deserialize<'de>, S: BuildHasher + Default, { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de>, { HashSet::<V, S>::deserialize(deserializer).map(|r| HashableHashSet(r)) } } #[cfg(test)] mod hashable_hash_set_test { use crate::fingerprint; use crate::util::HashableHashSet; #[test] fn different_hash_if_items_differ() { let mut set = HashableHashSet::new(); set.insert("one"); set.insert("two"); set.insert("three"); let fp1 = fingerprint(&set); let mut set = HashableHashSet::new(); set.insert("four"); set.insert("five"); set.insert("six"); let fp2 = fingerprint(&set); assert_ne!(fp1, fp2); } #[test] fn insertion_order_is_irrelevant() { let mut set = HashableHashSet::new(); set.insert("one"); set.insert("two"); set.insert("three"); let fp1 = fingerprint(&set); let mut set = HashableHashSet::new(); set.insert("three"); set.insert("one"); set.insert("two"); let fp2 = fingerprint(&set); assert_eq!(fp1, fp2); } #[test] fn can_hash_set_of_sets() { // This is a regression test for a case that used to cause `hash` to panic. let mut set = HashableHashSet::new(); set.insert({ let mut set = HashableHashSet::new(); set.insert("value"); set }); fingerprint(&set); // No assertion as this test is just checking for a panic. } } /// A [`HashMap`] wrapper that implements [`Hash`] by sorting pre-hashed entries and feeding those back /// into the passed-in [`Hasher`]. #[derive(Clone)] pub struct HashableHashMap<K, V, S = ahash::RandomState>(HashMap<K, V, S>); impl<K, V> HashableHashMap<K, V> { #[inline] pub fn new() -> HashableHashMap<K, V, ahash::RandomState> { Default::default() } #[inline] pub fn with_capacity(capacity: usize) -> HashableHashMap<K, V, ahash::RandomState> { HashableHashMap(HashMap::with_capacity_and_hasher(capacity, Default::default())) } } impl<K, V, S> HashableHashMap<K, V, S> { #[inline] pub fn with_hasher(hasher: S) -> Self { HashableHashMap(HashMap::with_hasher(hasher)) } #[inline] pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> Self { HashableHashMap(HashMap::with_capacity_and_hasher(capacity, hasher)) } } impl<K: Debug, V: Debug, S> Debug for HashableHashMap<K, V, S> { fn fmt(&self, f: &mut Formatter) -> fmt::Result { self.0.fmt(f) // transparent } } impl<K, V, S: Default> Default for HashableHashMap<K, V, S> { #[inline] fn default() -> Self { HashableHashMap::with_hasher(S::default()) } } impl<K, V, S> Deref for HashableHashMap<K, V, S> { type Target = HashMap<K, V, S>; fn deref(&self) -> &Self::Target { &self.0 } } impl<K, V, S> DerefMut for HashableHashMap<K, V, S> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl<K: Eq + Hash, V: Eq, S: BuildHasher> Eq for HashableHashMap<K, V, S> {} impl<K: Eq + Hash, V: Hash + Eq, S: BuildHasher> PartialOrd for HashableHashMap<K, V, S> { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { calculate_hash(self).partial_cmp(&calculate_hash(other)) } } impl<K: Eq + Hash, V: Hash + Eq, S: BuildHasher> Ord for HashableHashMap<K, V, S> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { calculate_hash(self).cmp(&calculate_hash(other)) } } impl<K: Eq + Hash, V, S: BuildHasher + Default> FromIterator<(K, V)> for HashableHashMap<K, V, S> { fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self { HashableHashMap(HashMap::from_iter(iter)) } } impl<K: Hash, V: Hash, S> Hash for HashableHashMap<K, V, S> { fn hash<H: Hasher>(&self, state: &mut H) { BUFFER.with(|buffer| { // The cached buffer might already be in use farther up the call stack, so the // algorithm reverts to a fallback as needed. let fallback = RefCell::new(Vec::new()); let mut buffer = buffer .try_borrow_mut() .unwrap_or_else(|_| fallback.borrow_mut()); buffer.clear(); buffer.extend(self.0.iter().map(|(k, v)| { let mut inner_hasher = crate::stable::hasher(); k.hash(&mut inner_hasher); v.hash(&mut inner_hasher); inner_hasher.finish() })); buffer.sort_unstable(); for hash in &*buffer { state.write_u64(*hash); } }); } } impl<'a, K, V, S> IntoIterator for &'a HashableHashMap<K, V, S> { type Item = (&'a K, &'a V); type IntoIter = std::collections::hash_map::Iter<'a, K, V>; #[inline] fn into_iter(self) -> std::collections::hash_map::Iter<'a, K, V> { self.0.iter() } } impl<K: Hash + Eq, V: PartialEq, S: BuildHasher> PartialEq for HashableHashMap<K, V, S> { fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } } impl<K, V, S> serde::Serialize for HashableHashMap<K, V, S> where K: Eq + Hash + serde::Serialize, V: serde::Serialize, S: BuildHasher, { fn serialize<Ser: serde::Serializer>(&self, ser: Ser) -> Result<Ser::Ok, Ser::Error> { self.0.serialize(ser) } } #[cfg(test)] mod hashable_hash_map_test { use crate::fingerprint; use crate::util::HashableHashMap; #[test] fn different_hash_if_items_differ() { let mut map = HashableHashMap::new(); map.insert("one", 1); map.insert("two", 2); map.insert("three", 3); let fp1 = fingerprint(&map); // Same keys as the first map (different values). let mut map = HashableHashMap::new(); map.insert("one", 4); map.insert("two", 5); map.insert("three", 6); let fp2 = fingerprint(&map); // Same values as the first map (different keys). let mut map = HashableHashMap::new(); map.insert("four", 1); map.insert("five", 2); map.insert("six", 3); let fp3 = fingerprint(&map); assert_ne!(fp1, fp2); assert_ne!(fp1, fp3); assert_ne!(fp2, fp3); } #[test] fn insertion_order_is_irrelevant() { let mut map = HashableHashMap::new(); map.insert("one", 1); map.insert("two", 2); map.insert("three", 3); let fp1 = fingerprint(&map); let mut map = HashableHashMap::new(); map.insert("three", 3); map.insert("one", 1); map.insert("two", 2); let fp2 = fingerprint(&map); assert_eq!(fp1, fp2); } #[test] fn can_hash_map_of_maps() { // This is a regression test for a case that used to cause `hash` to panic. let mut map = HashableHashMap::new(); map.insert("key", { let mut map = HashableHashMap::new(); map.insert("key", "value"); map }); fingerprint(&map); // No assertion as this test is just checking for a panic. } }
// Copyright 2019 // by Centrality Investments Ltd. // and Parity Technologies (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use crate::tm_std::*; use crate::{ form::{CompactForm, Form, MetaForm}, IntoCompact, MetaType, Metadata, Registry, }; use derive_more::From; use serde::Serialize; /// Types implementing this trait can communicate their type structure. /// /// If the current type contains any other types, `type_def` would register their metadata into the given /// `registry`. For instance, `<Option<MyStruct>>::type_def()` would register `MyStruct` metadata. All /// implementation must register these contained types' metadata. pub trait HasTypeDef { /// Returns the type definition for `Self` type. fn type_def() -> TypeDef; } /// A type definition represents the internal structure of a concrete type. #[derive(PartialEq, Eq, Debug, Serialize, From)] #[serde(bound = "F::TypeId: Serialize")] #[serde(untagged)] pub enum TypeDef<F: Form = MetaForm> { /// A builtin type that has an implied and known internal structure. Builtin(Builtin), /// A struct with named fields. Struct(TypeDefStruct<F>), /// A tuple-struct with unnamed fields. TupleStruct(TypeDefTupleStruct<F>), /// A C-like enum with simple named variants. ClikeEnum(TypeDefClikeEnum<F>), /// A Rust enum with different kinds of variants. Enum(TypeDefEnum<F>), /// An unsafe Rust union type. Union(TypeDefUnion<F>), } impl TypeDef { /// Preferred way to create a builtin type definition. pub fn builtin() -> Self { TypeDef::Builtin(Builtin::Builtin) } } /// This struct just exists for the purpose of better JSON output. #[derive(PartialEq, Eq, Debug, Serialize)] pub enum Builtin { /// This enum variant just exists for the purpose of special JSON output. #[serde(rename = "builtin")] Builtin, } impl IntoCompact for TypeDef { type Output = TypeDef<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { match self { TypeDef::Builtin(builtin) => TypeDef::Builtin(builtin), TypeDef::Struct(r#struct) => r#struct.into_compact(registry).into(), TypeDef::TupleStruct(tuple_struct) => tuple_struct.into_compact(registry).into(), TypeDef::ClikeEnum(clike_enum) => clike_enum.into_compact(registry).into(), TypeDef::Enum(r#enum) => r#enum.into_compact(registry).into(), TypeDef::Union(union) => union.into_compact(registry).into(), } } } /// A Rust struct with named fields. /// /// # Example /// /// ``` /// struct Person { /// name: String, /// age_in_years: u8, /// friends: Vec<Person>, /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct TypeDefStruct<F: Form = MetaForm> { /// The named fields of the struct. #[serde(rename = "struct.fields")] fields: Vec<NamedField<F>>, } impl IntoCompact for TypeDefStruct { type Output = TypeDefStruct<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { TypeDefStruct { fields: self .fields .into_iter() .map(|field| field.into_compact(registry)) .collect::<Vec<_>>(), } } } impl TypeDefStruct { /// Creates a new struct definition with named fields. pub fn new<F>(fields: F) -> Self where F: IntoIterator<Item = NamedField>, { Self { fields: fields.into_iter().collect(), } } } /// A named field. /// /// This can be a named field of a struct type or a struct variant. #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct NamedField<F: Form = MetaForm> { /// The name of the field. name: F::String, /// The type of the field. #[serde(rename = "type")] ty: F::TypeId, } impl IntoCompact for NamedField { type Output = NamedField<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { NamedField { name: registry.register_string(self.name), ty: registry.register_type(&self.ty), } } } impl NamedField { /// Creates a new named field. /// /// Use this constructor if you want to instantiate from a given meta type. pub fn new(name: <MetaForm as Form>::String, ty: MetaType) -> Self { Self { name, ty } } /// Creates a new named field. /// /// Use this constructor if you want to instantiate from a given compile-time type. pub fn of<T>(name: <MetaForm as Form>::String) -> Self where T: Metadata + ?Sized + 'static, { Self::new(name, MetaType::new::<T>()) } } /// A tuple struct with unnamed fields. /// /// # Example /// /// ``` /// struct Color(u8, u8, u8); /// ``` /// or a so-called unit struct /// ``` /// struct JustAMarker; /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct TypeDefTupleStruct<F: Form = MetaForm> { /// The unnamed fields. #[serde(rename = "tuple_struct.types")] fields: Vec<UnnamedField<F>>, } impl IntoCompact for TypeDefTupleStruct { type Output = TypeDefTupleStruct<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { TypeDefTupleStruct { fields: self .fields .into_iter() .map(|field| field.into_compact(registry)) .collect::<Vec<_>>(), } } } impl TypeDefTupleStruct { /// Creates a new tuple-struct. pub fn new<F>(fields: F) -> Self where F: IntoIterator<Item = UnnamedField>, { Self { fields: fields.into_iter().collect(), } } /// Creates the unit tuple-struct that has no fields. pub fn unit() -> Self { Self { fields: vec![] } } } /// An unnamed field from either a tuple-struct type or a tuple-struct variant. #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] #[serde(transparent)] pub struct UnnamedField<F: Form = MetaForm> { /// The type of the unnamed field. #[serde(rename = "type")] ty: F::TypeId, } impl IntoCompact for UnnamedField { type Output = UnnamedField<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { UnnamedField { ty: registry.register_type(&self.ty), } } } impl UnnamedField { /// Creates a new unnamed field. /// /// Use this constructor if you want to instantiate from a given meta type. pub fn new(meta_type: MetaType) -> Self { Self { ty: meta_type } } /// Creates a new unnamed field. /// /// Use this constructor if you want to instantiate from a given compile-time type. pub fn of<T>() -> Self where T: Metadata + ?Sized + 'static, { Self::new(MetaType::new::<T>()) } } /// A C-like enum type. /// /// # Example /// /// ``` /// enum Days { /// Monday, /// Tuesday, /// Wednesday, /// Thursday = 42, // Also allows to manually set the discriminant! /// Friday, /// Saturday, /// Sunday, /// } /// ``` /// or an empty enum (for marker purposes) /// ``` /// enum JustAMarker {} /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct TypeDefClikeEnum<F: Form = MetaForm> { /// The variants of the C-like enum. #[serde(rename = "clike_enum.variants")] variants: Vec<ClikeEnumVariant<F>>, } impl IntoCompact for TypeDefClikeEnum { type Output = TypeDefClikeEnum<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { TypeDefClikeEnum { variants: self .variants .into_iter() .map(|variant| variant.into_compact(registry)) .collect::<Vec<_>>(), } } } impl TypeDefClikeEnum { /// Creates a new C-like enum from the given variants. pub fn new<V>(variants: V) -> Self where V: IntoIterator<Item = ClikeEnumVariant>, { Self { variants: variants.into_iter().collect(), } } } /// A C-like enum variant. /// /// # Example /// /// ``` /// enum Food { /// Pizza, /// // ^^^^^ this is a C-like enum variant /// Salad = 1337, /// // ^^^^^ this as well /// Apple, /// // ^^^^^ and this /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] pub struct ClikeEnumVariant<F: Form = MetaForm> { /// The name of the variant. name: F::String, /// The disciminant of the variant. /// /// # Note /// /// Even though setting the discriminant is optional /// every C-like enum variant has a discriminant specified /// upon compile-time. discriminant: u64, } impl IntoCompact for ClikeEnumVariant { type Output = ClikeEnumVariant<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { ClikeEnumVariant { name: registry.register_string(self.name), discriminant: self.discriminant, } } } impl ClikeEnumVariant { /// Creates a new C-like enum variant. pub fn new<D>(name: <MetaForm as Form>::String, discriminant: D) -> Self where D: Into<u64>, { Self { name, discriminant: discriminant.into(), } } } /// A Rust enum, aka tagged union. /// /// # Examples /// /// ``` /// enum MyEnum { /// RustAllowsForClikeVariants, /// AndAlsoForTupleStructs(i32, bool), /// OrStructs { /// with: i32, /// named: bool, /// fields: [u8; 32], /// }, /// ItIsntPossibleToSetADiscriminantThough, /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct TypeDefEnum<F: Form = MetaForm> { /// The variants of the enum. #[serde(rename = "enum.variants")] variants: Vec<EnumVariant<F>>, } impl IntoCompact for TypeDefEnum { type Output = TypeDefEnum<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { TypeDefEnum { variants: self .variants .into_iter() .map(|variant| variant.into_compact(registry)) .collect::<Vec<_>>(), } } } impl TypeDefEnum { /// Creates a new Rust enum from the given variants. pub fn new<V>(variants: V) -> Self where V: IntoIterator<Item = EnumVariant>, { Self { variants: variants.into_iter().collect(), } } } /// A Rust enum variant. /// /// This can either be a unit struct, just like in C-like enums, /// a tuple-struct with unnamed fields, /// or a struct with named fields. #[derive(PartialEq, Eq, Debug, Serialize, From)] #[serde(bound = "F::TypeId: Serialize")] #[serde(untagged)] pub enum EnumVariant<F: Form = MetaForm> { /// A unit struct variant. Unit(EnumVariantUnit<F>), /// A struct variant with named fields. Struct(EnumVariantStruct<F>), /// A tuple-struct variant with unnamed fields. TupleStruct(EnumVariantTupleStruct<F>), } impl IntoCompact for EnumVariant { type Output = EnumVariant<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { match self { EnumVariant::Unit(unit) => unit.into_compact(registry).into(), EnumVariant::Struct(r#struct) => r#struct.into_compact(registry).into(), EnumVariant::TupleStruct(tuple_struct) => tuple_struct.into_compact(registry).into(), } } } /// An unit struct enum variant. /// /// These are similar to the variants in C-like enums. /// /// # Example /// /// ``` /// enum Operation { /// Zero, /// // ^^^^ this is a unit struct enum variant /// Add(i32, i32), /// Minus { source: i32 } /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] pub struct EnumVariantUnit<F: Form = MetaForm> { /// The name of the variant. #[serde(rename = "unit_variant.name")] name: F::String, } impl IntoCompact for EnumVariantUnit { type Output = EnumVariantUnit<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { EnumVariantUnit { name: registry.register_string(self.name), } } } impl EnumVariantUnit { /// Creates a new unit struct variant. pub fn new(name: &'static str) -> Self { Self { name } } } /// A struct enum variant with named fields. /// /// # Example /// /// ``` /// enum Operation { /// Zero, /// Add(i32, i32), /// Minus { source: i32 } /// // ^^^^^^^^^^^^^^^^^^^^^ this is a struct enum variant /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct EnumVariantStruct<F: Form = MetaForm> { /// The name of the struct variant. #[serde(rename = "struct_variant.name")] name: F::String, /// The fields of the struct variant. #[serde(rename = "struct_variant.fields")] fields: Vec<NamedField<F>>, } impl IntoCompact for EnumVariantStruct { type Output = EnumVariantStruct<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { EnumVariantStruct { name: registry.register_string(self.name), fields: self .fields .into_iter() .map(|field| field.into_compact(registry)) .collect::<Vec<_>>(), } } } impl EnumVariantStruct { /// Creates a new struct variant from the given fields. pub fn new<F>(name: <MetaForm as Form>::String, fields: F) -> Self where F: IntoIterator<Item = NamedField>, { Self { name, fields: fields.into_iter().collect(), } } } /// A tuple struct enum variant. /// /// # Example /// /// ``` /// enum Operation { /// Zero, /// Add(i32, i32), /// // ^^^^^^^^^^^^^ this is a tuple-struct enum variant /// Minus { /// source: i32, /// } /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct EnumVariantTupleStruct<F: Form = MetaForm> { /// The name of the variant. #[serde(rename = "tuple_struct_variant.name")] name: F::String, /// The fields of the variant. #[serde(rename = "tuple_struct_variant.types")] fields: Vec<UnnamedField<F>>, } impl IntoCompact for EnumVariantTupleStruct { type Output = EnumVariantTupleStruct<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { EnumVariantTupleStruct { name: registry.register_string(self.name), fields: self .fields .into_iter() .map(|field| field.into_compact(registry)) .collect::<Vec<_>>(), } } } impl EnumVariantTupleStruct { /// Creates a new tuple struct enum variant from the given fields. pub fn new<F>(name: <MetaForm as Form>::String, fields: F) -> Self where F: IntoIterator<Item = UnnamedField>, { Self { name, fields: fields.into_iter().collect(), } } } /// A union, aka untagged union, type definition. /// /// # Example /// /// ``` /// union SmallVecI32 { /// inl: [i32; 8], /// ext: *mut i32, /// } /// ``` #[derive(PartialEq, Eq, Debug, Serialize)] #[serde(bound = "F::TypeId: Serialize")] pub struct TypeDefUnion<F: Form = MetaForm> { /// The fields of the union. #[serde(rename = "union.fields")] fields: Vec<NamedField<F>>, } impl IntoCompact for TypeDefUnion { type Output = TypeDefUnion<CompactForm>; fn into_compact(self, registry: &mut Registry) -> Self::Output { TypeDefUnion { fields: self .fields .into_iter() .map(|field| field.into_compact(registry)) .collect::<Vec<_>>(), } } } impl TypeDefUnion { /// Creates a new union type definition from the given named fields. pub fn new<F>(fields: F) -> Self where F: IntoIterator<Item = NamedField>, { Self { fields: fields.into_iter().collect(), } } }