uniffi::assert_compatible_version!("0.21.1"); #[allow(clippy::missing_safety_doc)]
#[no_mangle]
pub extern "C" fn ffi_jormungandr_wallet_62a5_rustbuffer_alloc(
size: i32,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::ffi::uniffi_rustbuffer_alloc(size, call_status)
}
#[allow(clippy::missing_safety_doc)]
#[no_mangle]
pub unsafe extern "C" fn ffi_jormungandr_wallet_62a5_rustbuffer_from_bytes(
bytes: uniffi::ForeignBytes,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::ffi::uniffi_rustbuffer_from_bytes(bytes, call_status)
}
#[allow(clippy::missing_safety_doc)]
#[no_mangle]
pub unsafe extern "C" fn ffi_jormungandr_wallet_62a5_rustbuffer_free(
buf: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::ffi::uniffi_rustbuffer_free(buf, call_status)
}
#[allow(clippy::missing_safety_doc)]
#[no_mangle]
pub unsafe extern "C" fn ffi_jormungandr_wallet_62a5_rustbuffer_reserve(
buf: uniffi::RustBuffer,
additional: i32,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::ffi::uniffi_rustbuffer_reserve(buf, additional, call_status)
}
#[doc(hidden)]
pub struct FfiConverterTypeWalletError;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeWalletError {
type RustType = r#WalletError;
fn write(obj: r#WalletError, buf: &mut std::vec::Vec<u8>) {
use uniffi::deps::bytes::BufMut;
let msg = obj.to_string();
match obj {
r#WalletError::r#InvalidEncryptionKey { .. } => {
buf.put_i32(1);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#MalformedVotePlanId { .. } => {
buf.put_i32(2);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#CoreError { .. } => {
buf.put_i32(3);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#MalformedBlock0Hash { .. } => {
buf.put_i32(4);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#MalformedSecretKey { .. } => {
buf.put_i32(5);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#TimeError { .. } => {
buf.put_i32(6);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#CipherError { .. } => {
buf.put_i32(7);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#InvalidFragment { .. } => {
buf.put_i32(8);
<String as uniffi::FfiConverter>::write(msg, buf);
}
r#WalletError::r#InvalidSpendingCounters { .. } => {
buf.put_i32(9);
<String as uniffi::FfiConverter>::write(msg, buf);
}
};
}
fn try_read(_buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#WalletError> {
panic!("try_read not supported for flat errors");
}
}
impl uniffi::FfiError for FfiConverterTypeWalletError {}
#[doc(hidden)]
pub struct FfiConverterTypeDiscrimination;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeDiscrimination {
type RustType = r#Discrimination;
fn write(obj: Self::RustType, buf: &mut std::vec::Vec<u8>) {
use uniffi::deps::bytes::BufMut;
match obj {
r#Discrimination::r#Production {} => {
buf.put_i32(1);
}
r#Discrimination::r#Test {} => {
buf.put_i32(2);
}
};
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#Discrimination> {
use uniffi::deps::bytes::Buf;
uniffi::check_remaining(buf, 4)?;
Ok(match buf.get_i32() {
1 => r#Discrimination::r#Production,
2 => r#Discrimination::r#Test,
v => uniffi::deps::anyhow::bail!("Invalid Discrimination enum value: {}", v),
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypePayloadTypeConfig;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypePayloadTypeConfig {
type RustType = r#PayloadTypeConfig;
fn write(obj: Self::RustType, buf: &mut std::vec::Vec<u8>) {
use uniffi::deps::bytes::BufMut;
match obj {
r#PayloadTypeConfig::r#Public {} => {
buf.put_i32(1);
}
r#PayloadTypeConfig::r#Private { r#encryption_key } => {
buf.put_i32(2);
<String as uniffi::FfiConverter>::write(r#encryption_key, buf);
}
};
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#PayloadTypeConfig> {
use uniffi::deps::bytes::Buf;
uniffi::check_remaining(buf, 4)?;
Ok(match buf.get_i32() {
1 => r#PayloadTypeConfig::r#Public,
2 => r#PayloadTypeConfig::r#Private {
r#encryption_key: <String as uniffi::FfiConverter>::try_read(buf)?,
},
v => uniffi::deps::anyhow::bail!("Invalid PayloadTypeConfig enum value: {}", v),
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypeLinearFee;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeLinearFee {
type RustType = r#LinearFee;
fn write(obj: r#LinearFee, buf: &mut std::vec::Vec<u8>) {
<u64 as uniffi::FfiConverter>::write(obj.r#constant, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#coefficient, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#certificate, buf);
<FfiConverterTypePerCertificateFee as uniffi::FfiConverter>::write(
obj.r#per_certificate_fees,
buf,
);
<FfiConverterTypePerVoteCertificateFee as uniffi::FfiConverter>::write(
obj.r#per_vote_certificate_fees,
buf,
);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#LinearFee> {
Ok(r#LinearFee {
r#constant: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#coefficient: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#certificate: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#per_certificate_fees:
<FfiConverterTypePerCertificateFee as uniffi::FfiConverter>::try_read(buf)?,
r#per_vote_certificate_fees:
<FfiConverterTypePerVoteCertificateFee as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypePerCertificateFee;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypePerCertificateFee {
type RustType = r#PerCertificateFee;
fn write(obj: r#PerCertificateFee, buf: &mut std::vec::Vec<u8>) {
<u64 as uniffi::FfiConverter>::write(obj.r#certificate_pool_registration, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#certificate_stake_delegation, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#certificate_owner_stake_delegation, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#PerCertificateFee> {
Ok(r#PerCertificateFee {
r#certificate_pool_registration: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#certificate_stake_delegation: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#certificate_owner_stake_delegation: <u64 as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypePerVoteCertificateFee;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypePerVoteCertificateFee {
type RustType = r#PerVoteCertificateFee;
fn write(obj: r#PerVoteCertificateFee, buf: &mut std::vec::Vec<u8>) {
<u64 as uniffi::FfiConverter>::write(obj.r#certificate_vote_plan, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#certificate_vote_cast, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#PerVoteCertificateFee> {
Ok(r#PerVoteCertificateFee {
r#certificate_vote_plan: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#certificate_vote_cast: <u64 as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypeTimeEra;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeTimeEra {
type RustType = r#TimeEra;
fn write(obj: r#TimeEra, buf: &mut std::vec::Vec<u8>) {
<u32 as uniffi::FfiConverter>::write(obj.r#epoch_start, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#slot_start, buf);
<u32 as uniffi::FfiConverter>::write(obj.r#slots_per_epoch, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#TimeEra> {
Ok(r#TimeEra {
r#epoch_start: <u32 as uniffi::FfiConverter>::try_read(buf)?,
r#slot_start: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#slots_per_epoch: <u32 as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypeSettingsRaw;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeSettingsRaw {
type RustType = r#SettingsRaw;
fn write(obj: r#SettingsRaw, buf: &mut std::vec::Vec<u8>) {
<FfiConverterTypeLinearFee as uniffi::FfiConverter>::write(obj.r#fees, buf);
<FfiConverterTypeDiscrimination as uniffi::FfiConverter>::write(obj.r#discrimination, buf);
<std::vec::Vec<u8> as uniffi::FfiConverter>::write(obj.r#block0_hash, buf);
<u64 as uniffi::FfiConverter>::write(obj.r#block0_date, buf);
<u8 as uniffi::FfiConverter>::write(obj.r#slot_duration, buf);
<FfiConverterTypeTimeEra as uniffi::FfiConverter>::write(obj.r#time_era, buf);
<u8 as uniffi::FfiConverter>::write(obj.r#transaction_max_expiry_epochs, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#SettingsRaw> {
Ok(r#SettingsRaw {
r#fees: <FfiConverterTypeLinearFee as uniffi::FfiConverter>::try_read(buf)?,
r#discrimination: <FfiConverterTypeDiscrimination as uniffi::FfiConverter>::try_read(
buf,
)?,
r#block0_hash: <std::vec::Vec<u8> as uniffi::FfiConverter>::try_read(buf)?,
r#block0_date: <u64 as uniffi::FfiConverter>::try_read(buf)?,
r#slot_duration: <u8 as uniffi::FfiConverter>::try_read(buf)?,
r#time_era: <FfiConverterTypeTimeEra as uniffi::FfiConverter>::try_read(buf)?,
r#transaction_max_expiry_epochs: <u8 as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypeProposal;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeProposal {
type RustType = r#Proposal;
fn write(obj: r#Proposal, buf: &mut std::vec::Vec<u8>) {
<std::vec::Vec<u8> as uniffi::FfiConverter>::write(obj.r#vote_plan_id, buf);
<u8 as uniffi::FfiConverter>::write(obj.r#index, buf);
<u8 as uniffi::FfiConverter>::write(obj.r#options, buf);
<FfiConverterTypePayloadTypeConfig as uniffi::FfiConverter>::write(obj.r#payload_type, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#Proposal> {
Ok(r#Proposal {
r#vote_plan_id: <std::vec::Vec<u8> as uniffi::FfiConverter>::try_read(buf)?,
r#index: <u8 as uniffi::FfiConverter>::try_read(buf)?,
r#options: <u8 as uniffi::FfiConverter>::try_read(buf)?,
r#payload_type: <FfiConverterTypePayloadTypeConfig as uniffi::FfiConverter>::try_read(
buf,
)?,
})
}
}
#[doc(hidden)]
pub struct FfiConverterTypeBlockDate;
#[doc(hidden)]
impl uniffi::RustBufferFfiConverter for FfiConverterTypeBlockDate {
type RustType = r#BlockDate;
fn write(obj: r#BlockDate, buf: &mut std::vec::Vec<u8>) {
<u32 as uniffi::FfiConverter>::write(obj.r#epoch, buf);
<u32 as uniffi::FfiConverter>::write(obj.r#slot, buf);
}
fn try_read(buf: &mut &[u8]) -> uniffi::deps::anyhow::Result<r#BlockDate> {
Ok(r#BlockDate {
r#epoch: <u32 as uniffi::FfiConverter>::try_read(buf)?,
r#slot: <u32 as uniffi::FfiConverter>::try_read(buf)?,
})
}
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_block_date_from_system_time(
r#settings: *const std::os::raw::c_void,
r#unix_epoch: u64,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_block_date_from_system_time");
uniffi::call_with_result(call_status, || {
let _retval = r#block_date_from_system_time(
match <std::sync::Arc<r#Settings> as uniffi::FfiConverter>::try_lift(r#settings) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "settings"))
}
},
match <u64 as uniffi::FfiConverter>::try_lift(r#unix_epoch) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "unix_epoch"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
Ok(<FfiConverterTypeBlockDate as uniffi::FfiConverter>::lower(
_retval,
))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_max_expiration_date(
r#settings: *const std::os::raw::c_void,
r#current_time: u64,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_max_expiration_date");
uniffi::call_with_result(call_status, || {
let _retval = r#max_expiration_date(
match <std::sync::Arc<r#Settings> as uniffi::FfiConverter>::try_lift(r#settings) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "settings"))
}
},
match <u64 as uniffi::FfiConverter>::try_lift(r#current_time) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "current_time"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
Ok(<FfiConverterTypeBlockDate as uniffi::FfiConverter>::lower(
_retval,
))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_symmetric_cipher_decrypt(
r#password: uniffi::RustBuffer,
r#ciphertext: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_symmetric_cipher_decrypt");
uniffi::call_with_result(call_status, || {
let _retval = r#symmetric_cipher_decrypt(
match <std::vec::Vec<u8> as uniffi::FfiConverter>::try_lift(r#password) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "password"))
}
},
match <std::vec::Vec<u8> as uniffi::FfiConverter>::try_lift(r#ciphertext) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "ciphertext"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
Ok(<std::vec::Vec<u8> as uniffi::FfiConverter>::lower(_retval))
})
}
uniffi::deps::static_assertions::assert_impl_all!(r#Wallet: Sync, Send);
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn ffi_jormungandr_wallet_62a5_Wallet_object_free(
ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::call_with_output(call_status, || {
assert!(!ptr.is_null());
drop(unsafe { std::sync::Arc::from_raw(ptr as *const r#Wallet) })
})
}
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_new(
r#account_key: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> *const std::os::raw::c_void {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_new");
uniffi::call_with_result(call_status, || {
let _new = r#Wallet::r#new(
match <std::sync::Arc<r#SecretKeyEd25519Extended> as uniffi::FfiConverter>::try_lift(
r#account_key,
) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "account_key"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
let _arc = std::sync::Arc::new(_new);
Ok(<std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::lower(
_arc,
))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_set_state(
r#ptr: *const std::os::raw::c_void,
r#value: u64,
r#counter: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_set_state");
uniffi::call_with_result(call_status, || {
let _retval = r#Wallet::r#set_state(
match <std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "ptr"))
}
},
match <u64 as uniffi::FfiConverter>::try_lift(r#value) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "value"))
}
},
match <std::vec::Vec<u32> as uniffi::FfiConverter>::try_lift(r#counter) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "counter"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
Ok(_retval)
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_vote(
r#ptr: *const std::os::raw::c_void,
r#settings: *const std::os::raw::c_void,
r#proposal: uniffi::RustBuffer,
r#choice: u8,
r#valid_until: uniffi::RustBuffer,
r#lane: u8,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_vote");
uniffi::call_with_result(call_status, || {
let _retval = r#Wallet::r#vote(
match <std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "ptr"))
}
},
match <std::sync::Arc<r#Settings> as uniffi::FfiConverter>::try_lift(r#settings) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "settings"))
}
},
match <FfiConverterTypeProposal as uniffi::FfiConverter>::try_lift(r#proposal) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "proposal"))
}
},
match <u8 as uniffi::FfiConverter>::try_lift(r#choice) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "choice"))
}
},
match <FfiConverterTypeBlockDate as uniffi::FfiConverter>::try_lift(r#valid_until) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "valid_until"))
}
},
match <u8 as uniffi::FfiConverter>::try_lift(r#lane) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "lane"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
Ok(<std::vec::Vec<u8> as uniffi::FfiConverter>::lower(_retval))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_account_id(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_account_id");
uniffi::call_with_output(call_status, || {
let retval = r#Wallet::r#account_id(
match <std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<std::vec::Vec<u8> as uniffi::FfiConverter>::lower(retval)
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_spending_counters(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_spending_counters");
uniffi::call_with_output(call_status, || {
let retval = r#Wallet::r#spending_counters(
match <std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<std::vec::Vec<u32> as uniffi::FfiConverter>::lower(retval)
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Wallet_total_value(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> u64 {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Wallet_total_value");
uniffi::call_with_output(call_status, || {
let retval = r#Wallet::r#total_value(
match <std::sync::Arc<r#Wallet> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<u64 as uniffi::FfiConverter>::lower(retval)
})
}
uniffi::deps::static_assertions::assert_impl_all!(r#SecretKeyEd25519Extended: Sync, Send);
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn ffi_jormungandr_wallet_62a5_SecretKeyEd25519Extended_object_free(
ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::call_with_output(call_status, || {
assert!(!ptr.is_null());
drop(unsafe { std::sync::Arc::from_raw(ptr as *const r#SecretKeyEd25519Extended) })
})
}
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn r#jormungandr_wallet_62a5_SecretKeyEd25519Extended_new(
r#raw: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) -> *const std::os::raw::c_void {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_SecretKeyEd25519Extended_new");
uniffi::call_with_result(call_status, || {
let _new = r#SecretKeyEd25519Extended::r#new(
match <std::vec::Vec<u8> as uniffi::FfiConverter>::try_lift(r#raw) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "raw"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
let _arc = std::sync::Arc::new(_new);
Ok(<std::sync::Arc<r#SecretKeyEd25519Extended> as uniffi::FfiConverter>::lower(_arc))
})
}
uniffi::deps::static_assertions::assert_impl_all!(r#Fragment: Sync, Send);
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn ffi_jormungandr_wallet_62a5_Fragment_object_free(
ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::call_with_output(call_status, || {
assert!(!ptr.is_null());
drop(unsafe { std::sync::Arc::from_raw(ptr as *const r#Fragment) })
})
}
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn r#jormungandr_wallet_62a5_Fragment_new(
r#raw: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) -> *const std::os::raw::c_void {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Fragment_new");
uniffi::call_with_result(call_status, || {
let _new = r#Fragment::r#new(
match <std::vec::Vec<u8> as uniffi::FfiConverter>::try_lift(r#raw) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "raw"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
let _arc = std::sync::Arc::new(_new);
Ok(<std::sync::Arc<r#Fragment> as uniffi::FfiConverter>::lower(
_arc,
))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Fragment_id(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Fragment_id");
uniffi::call_with_output(call_status, || {
let retval = r#Fragment::r#id(
match <std::sync::Arc<r#Fragment> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<std::vec::Vec<u8> as uniffi::FfiConverter>::lower(retval)
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Fragment_serialize(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Fragment_serialize");
uniffi::call_with_output(call_status, || {
let retval = r#Fragment::r#serialize(
match <std::sync::Arc<r#Fragment> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<std::vec::Vec<u8> as uniffi::FfiConverter>::lower(retval)
})
}
uniffi::deps::static_assertions::assert_impl_all!(r#Settings: Sync, Send);
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn ffi_jormungandr_wallet_62a5_Settings_object_free(
ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) {
uniffi::call_with_output(call_status, || {
assert!(!ptr.is_null());
drop(unsafe { std::sync::Arc::from_raw(ptr as *const r#Settings) })
})
}
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn r#jormungandr_wallet_62a5_Settings_new(
r#settings: uniffi::RustBuffer,
call_status: &mut uniffi::RustCallStatus,
) -> *const std::os::raw::c_void {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Settings_new");
uniffi::call_with_result(call_status, || {
let _new = r#Settings::r#new(
match <FfiConverterTypeSettingsRaw as uniffi::FfiConverter>::try_lift(r#settings) {
Ok(val) => val,
Err(err) => {
return Err(uniffi::lower_anyhow_error_or_panic::<
FfiConverterTypeWalletError,
>(err, "settings"))
}
},
)
.map_err(Into::into)
.map_err(<FfiConverterTypeWalletError as uniffi::FfiConverter>::lower)?;
let _arc = std::sync::Arc::new(_new);
Ok(<std::sync::Arc<r#Settings> as uniffi::FfiConverter>::lower(
_arc,
))
})
}
#[doc(hidden)]
#[no_mangle]
#[allow(clippy::let_unit_value)] pub extern "C" fn r#jormungandr_wallet_62a5_Settings_settings_raw(
r#ptr: *const std::os::raw::c_void,
call_status: &mut uniffi::RustCallStatus,
) -> uniffi::RustBuffer {
uniffi::deps::log::debug!("jormungandr_wallet_62a5_Settings_settings_raw");
uniffi::call_with_output(call_status, || {
let retval = r#Settings::r#settings_raw(
match <std::sync::Arc<r#Settings> as uniffi::FfiConverter>::try_lift(r#ptr) {
Ok(ref val) => val,
Err(err) => panic!("Failed to convert arg '{}': {}", "ptr", err),
},
);
<FfiConverterTypeSettingsRaw as uniffi::FfiConverter>::lower(retval)
})
}
#[doc(hidden)]
pub fn uniffi_reexport_hack() {}
#[macro_export]
macro_rules! uniffi_reexport_scaffolding {
() => {
#[doc(hidden)]
#[no_mangle]
pub extern "C" fn jormungandr_wallet_uniffi_reexport_hack() {
$crate::uniffi_reexport_hack()
}
};
}