Operations possible: check, refresh, wipe, copy. Test coverage only on Unit test level atm. WIP - many TODOs remaining, Device tests not yet done, more error handling necessary.pull/3441/head
parent
cbd0fdcd5d
commit
696005613b
@ -0,0 +1,146 @@
|
|||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from storage.device import is_initialized
|
||||||
|
from trezor.utils import USE_SD_CARD
|
||||||
|
from trezor.wire import NotInitialized, ProcessError
|
||||||
|
from trezor.enums import SdCardBackupManageOperationType
|
||||||
|
from trezor.ui.layouts import confirm_action
|
||||||
|
|
||||||
|
from apps.common.sdcard import ensure_sdcard
|
||||||
|
from trezor.messages import (
|
||||||
|
Success,
|
||||||
|
Failure,
|
||||||
|
)
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from trezor.messages import (
|
||||||
|
SdCardBackupManage,
|
||||||
|
SdCardBackupHealth,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: this whole functionality is WIP
|
||||||
|
async def sd_backup_manage(
|
||||||
|
msg: SdCardBackupManage,
|
||||||
|
) -> Success | Failure | SdCardBackupHealth:
|
||||||
|
if not is_initialized():
|
||||||
|
raise NotInitialized("Device is not initialized")
|
||||||
|
|
||||||
|
if not USE_SD_CARD:
|
||||||
|
raise ProcessError("Device does not have SD card slot")
|
||||||
|
|
||||||
|
await ensure_sdcard(ensure_filesystem=False)
|
||||||
|
|
||||||
|
if msg.operation == SdCardBackupManageOperationType.CHECK:
|
||||||
|
print("sd_backup_manage: calling _check_health")
|
||||||
|
return await _check_health()
|
||||||
|
elif msg.operation == SdCardBackupManageOperationType.REFRESH:
|
||||||
|
return await _refresh()
|
||||||
|
elif msg.operation == SdCardBackupManageOperationType.WIPE:
|
||||||
|
return await _wipe()
|
||||||
|
elif msg.operation == SdCardBackupManageOperationType.COPY:
|
||||||
|
return await _copy()
|
||||||
|
else:
|
||||||
|
raise ProcessError("Unknown operation")
|
||||||
|
|
||||||
|
|
||||||
|
async def _check_health() -> SdCardBackupHealth:
|
||||||
|
from storage.device import get_backup_type, get_mnemonic_secret
|
||||||
|
from storage.sd_seed_backup import check_health_of_backup_sdcard
|
||||||
|
from trezor.enums import BackupType
|
||||||
|
|
||||||
|
print("_check_health: start")
|
||||||
|
|
||||||
|
await confirm_action(
|
||||||
|
"confirm_sd_backup_check",
|
||||||
|
"Check backup card",
|
||||||
|
action="Check action",
|
||||||
|
description="Checks health of the backup card.",
|
||||||
|
)
|
||||||
|
|
||||||
|
return check_health_of_backup_sdcard(
|
||||||
|
get_mnemonic_secret() if get_backup_type() == BackupType.Bip39 else None
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def _refresh() -> Success | Failure:
|
||||||
|
from storage.device import get_backup_type, get_mnemonic_secret
|
||||||
|
from trezor.ui.layouts.sdcard_eject import make_user_eject_sdcard
|
||||||
|
from trezor.enums import BackupType
|
||||||
|
from storage.sd_seed_backup import refresh_backup_sdcard
|
||||||
|
|
||||||
|
await confirm_action(
|
||||||
|
"confirm_sd_backup_refresh",
|
||||||
|
"Refresh backup card",
|
||||||
|
action="Refresh action",
|
||||||
|
description="Refreshes backup card.",
|
||||||
|
verb="REFRESH",
|
||||||
|
hold=True,
|
||||||
|
hold_danger=True,
|
||||||
|
)
|
||||||
|
success = refresh_backup_sdcard(
|
||||||
|
get_mnemonic_secret() if get_backup_type() == BackupType.Bip39 else None
|
||||||
|
)
|
||||||
|
|
||||||
|
await make_user_eject_sdcard()
|
||||||
|
return (
|
||||||
|
Success("SD backup card refreshed.")
|
||||||
|
if success
|
||||||
|
else Failure("SD backup card refresh failed.")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def _wipe() -> Success:
|
||||||
|
from storage.sd_seed_backup import wipe_backup_sdcard
|
||||||
|
|
||||||
|
await confirm_action(
|
||||||
|
"confirm_sd_backup_wipe",
|
||||||
|
"Wipe backup card",
|
||||||
|
action="Wipe action",
|
||||||
|
description="Erase backup card. This action is irreversible.",
|
||||||
|
verb="WIPE",
|
||||||
|
hold=True,
|
||||||
|
hold_danger=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
wipe_backup_sdcard()
|
||||||
|
return Success("SD backup card wiped.")
|
||||||
|
|
||||||
|
|
||||||
|
async def _copy() -> Success | Failure:
|
||||||
|
from storage.sd_seed_backup import store_seed_on_sdcard, recover_seed_from_sdcard
|
||||||
|
from trezor.ui.layouts.sdcard_eject import make_user_eject_sdcard
|
||||||
|
from trezor.ui.layouts import show_warning
|
||||||
|
from apps.common.sdcard import get_serial_num
|
||||||
|
|
||||||
|
# TODO do we allow copying sd cards with seed different than the one stored on the device?
|
||||||
|
await confirm_action(
|
||||||
|
"confirm_sd_backup_copy",
|
||||||
|
"Copy backup card",
|
||||||
|
action="Do you really want to copy the backup SD card?",
|
||||||
|
)
|
||||||
|
|
||||||
|
read_mnemonic, read_backup_type = recover_seed_from_sdcard()
|
||||||
|
if read_mnemonic is None or read_backup_type is None:
|
||||||
|
return Failure("SD backup card copy failed.")
|
||||||
|
sn = get_serial_num()
|
||||||
|
await make_user_eject_sdcard()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
await ensure_sdcard(ensure_filesystem=False)
|
||||||
|
new_sn = get_serial_num()
|
||||||
|
if new_sn == sn:
|
||||||
|
await show_warning(
|
||||||
|
"warning_sd_backup_same_card", "Insert a different card."
|
||||||
|
)
|
||||||
|
elif new_sn == 0:
|
||||||
|
return Failure("SD backup card copy failed.")
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
# NOTE: should we delegate `mkfs` to `store_seed_on_sdcard` ?
|
||||||
|
# TODO: code repetition with reset_device/__init__.py: sdcard_backup_seed(...)
|
||||||
|
await ensure_sdcard(ensure_filesystem=True, for_sd_backup=True)
|
||||||
|
store_seed_on_sdcard(read_mnemonic, read_backup_type)
|
||||||
|
await make_user_eject_sdcard()
|
||||||
|
return Success("SD card backup copy succeeded")
|
@ -0,0 +1,8 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
# isort:skip_file
|
||||||
|
|
||||||
|
CHECK = 0
|
||||||
|
REFRESH = 1
|
||||||
|
WIPE = 2
|
||||||
|
COPY = 3
|
@ -0,0 +1,40 @@
|
|||||||
|
from typing import TYPE_CHECKING, Optional
|
||||||
|
|
||||||
|
import click
|
||||||
|
|
||||||
|
from .. import messages, sd_backup
|
||||||
|
from . import with_client
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from ..client import TrezorClient
|
||||||
|
|
||||||
|
|
||||||
|
@click.group(name="sd-backup")
|
||||||
|
def cli() -> None:
|
||||||
|
"""SD backup management commands."""
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@with_client
|
||||||
|
def check(client: "TrezorClient") -> messages.SdCardBackupHealth:
|
||||||
|
"""Check health of SD backup."""
|
||||||
|
return sd_backup.check(client)
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@with_client
|
||||||
|
def refresh(client: "TrezorClient") -> messages.Success:
|
||||||
|
"""Refresh data on the SD backup card."""
|
||||||
|
return sd_backup.refresh(client)
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@with_client
|
||||||
|
def wipe(client: "TrezorClient") -> messages.Success:
|
||||||
|
"""Wipe the backup from SD card !!!CAUTION: IRREVERSIBLE OPERATION!!!"""
|
||||||
|
return sd_backup.wipe(client)
|
||||||
|
|
||||||
|
@cli.command()
|
||||||
|
@with_client
|
||||||
|
def copy(client: "TrezorClient") -> messages.Success | messages.Failure:
|
||||||
|
"""Copy a backup SD card to another SD card."""
|
||||||
|
return sd_backup.copy(client)
|
@ -0,0 +1,36 @@
|
|||||||
|
from typing import TYPE_CHECKING
|
||||||
|
from . import messages
|
||||||
|
from .tools import expect, session
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .client import TrezorClient
|
||||||
|
from .protobuf import MessageType
|
||||||
|
|
||||||
|
|
||||||
|
@expect(messages.SdCardBackupHealth)
|
||||||
|
@session
|
||||||
|
def check(client: "TrezorClient") -> "MessageType":
|
||||||
|
return client.call(
|
||||||
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.CHECK)
|
||||||
|
)
|
||||||
|
|
||||||
|
@expect(messages.Success)
|
||||||
|
@session
|
||||||
|
def refresh(client: "TrezorClient") -> "MessageType":
|
||||||
|
return client.call(
|
||||||
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.REFRESH)
|
||||||
|
)
|
||||||
|
|
||||||
|
@expect(messages.Success)
|
||||||
|
@session
|
||||||
|
def wipe(client: "TrezorClient") -> "MessageType":
|
||||||
|
return client.call(
|
||||||
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.WIPE)
|
||||||
|
)
|
||||||
|
|
||||||
|
@expect(messages.Success)
|
||||||
|
@session
|
||||||
|
def copy(client: "TrezorClient") -> "MessageType":
|
||||||
|
return client.call(
|
||||||
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.COPY)
|
||||||
|
)
|
@ -0,0 +1,789 @@
|
|||||||
|
// This file is generated by rust-protobuf 3.3.0. Do not edit
|
||||||
|
// .proto file is parsed by protoc 3.19.6
|
||||||
|
// @generated
|
||||||
|
|
||||||
|
// https://github.com/rust-lang/rust-clippy/issues/702
|
||||||
|
#![allow(unknown_lints)]
|
||||||
|
#![allow(clippy::all)]
|
||||||
|
|
||||||
|
#![allow(unused_attributes)]
|
||||||
|
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||||
|
|
||||||
|
#![allow(box_pointers)]
|
||||||
|
#![allow(dead_code)]
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
#![allow(non_camel_case_types)]
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
|
#![allow(trivial_casts)]
|
||||||
|
#![allow(unused_results)]
|
||||||
|
#![allow(unused_mut)]
|
||||||
|
|
||||||
|
//! Generated file from `messages-sdbackup.proto`
|
||||||
|
|
||||||
|
/// Generated files are compatible only with the same version
|
||||||
|
/// of protobuf runtime.
|
||||||
|
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0;
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(message:hw.trezor.messages.sdbackup.SdCardBackupCheckHealthRequest)
|
||||||
|
#[derive(PartialEq,Clone,Default,Debug)]
|
||||||
|
pub struct SdCardBackupCheckHealthRequest {
|
||||||
|
// special fields
|
||||||
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.sdbackup.SdCardBackupCheckHealthRequest.special_fields)
|
||||||
|
pub special_fields: ::protobuf::SpecialFields,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> ::std::default::Default for &'a SdCardBackupCheckHealthRequest {
|
||||||
|
fn default() -> &'a SdCardBackupCheckHealthRequest {
|
||||||
|
<SdCardBackupCheckHealthRequest as ::protobuf::Message>::default_instance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SdCardBackupCheckHealthRequest {
|
||||||
|
pub fn new() -> SdCardBackupCheckHealthRequest {
|
||||||
|
::std::default::Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
||||||
|
let mut fields = ::std::vec::Vec::with_capacity(0);
|
||||||
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
||||||
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SdCardBackupCheckHealthRequest>(
|
||||||
|
"SdCardBackupCheckHealthRequest",
|
||||||
|
fields,
|
||||||
|
oneofs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::Message for SdCardBackupCheckHealthRequest {
|
||||||
|
const NAME: &'static str = "SdCardBackupCheckHealthRequest";
|
||||||
|
|
||||||
|
fn is_initialized(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
||||||
|
match tag {
|
||||||
|
tag => {
|
||||||
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute sizes of nested messages
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn compute_size(&self) -> u64 {
|
||||||
|
let mut my_size = 0;
|
||||||
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
||||||
|
self.special_fields.cached_size().set(my_size as u32);
|
||||||
|
my_size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
||||||
|
&self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
||||||
|
&mut self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new() -> SdCardBackupCheckHealthRequest {
|
||||||
|
SdCardBackupCheckHealthRequest::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.special_fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_instance() -> &'static SdCardBackupCheckHealthRequest {
|
||||||
|
static instance: SdCardBackupCheckHealthRequest = SdCardBackupCheckHealthRequest {
|
||||||
|
special_fields: ::protobuf::SpecialFields::new(),
|
||||||
|
};
|
||||||
|
&instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::MessageFull for SdCardBackupCheckHealthRequest {
|
||||||
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
||||||
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("SdCardBackupCheckHealthRequest").unwrap()).clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::std::fmt::Display for SdCardBackupCheckHealthRequest {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::protobuf::text_format::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::reflect::ProtobufValue for SdCardBackupCheckHealthRequest {
|
||||||
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(message:hw.trezor.messages.sdbackup.SdCardBackupHealth)
|
||||||
|
#[derive(PartialEq,Clone,Default,Debug)]
|
||||||
|
pub struct SdCardBackupHealth {
|
||||||
|
// message fields
|
||||||
|
// @@protoc_insertion_point(field:hw.trezor.messages.sdbackup.SdCardBackupHealth.pt_is_mountable)
|
||||||
|
pub pt_is_mountable: ::std::option::Option<bool>,
|
||||||
|
// @@protoc_insertion_point(field:hw.trezor.messages.sdbackup.SdCardBackupHealth.pt_has_correct_cap)
|
||||||
|
pub pt_has_correct_cap: ::std::option::Option<bool>,
|
||||||
|
// @@protoc_insertion_point(field:hw.trezor.messages.sdbackup.SdCardBackupHealth.pt_readme_present)
|
||||||
|
pub pt_readme_present: ::std::option::Option<bool>,
|
||||||
|
// @@protoc_insertion_point(field:hw.trezor.messages.sdbackup.SdCardBackupHealth.pt_readme_content)
|
||||||
|
pub pt_readme_content: ::std::option::Option<bool>,
|
||||||
|
// @@protoc_insertion_point(field:hw.trezor.messages.sdbackup.SdCardBackupHealth.unalloc_seed_corrupt)
|
||||||
|
pub unalloc_seed_corrupt: ::std::option::Option<u32>,
|
||||||
|
// special fields
|
||||||
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.sdbackup.SdCardBackupHealth.special_fields)
|
||||||
|
pub special_fields: ::protobuf::SpecialFields,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> ::std::default::Default for &'a SdCardBackupHealth {
|
||||||
|
fn default() -> &'a SdCardBackupHealth {
|
||||||
|
<SdCardBackupHealth as ::protobuf::Message>::default_instance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SdCardBackupHealth {
|
||||||
|
pub fn new() -> SdCardBackupHealth {
|
||||||
|
::std::default::Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
// required bool pt_is_mountable = 1;
|
||||||
|
|
||||||
|
pub fn pt_is_mountable(&self) -> bool {
|
||||||
|
self.pt_is_mountable.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_pt_is_mountable(&mut self) {
|
||||||
|
self.pt_is_mountable = ::std::option::Option::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_pt_is_mountable(&self) -> bool {
|
||||||
|
self.pt_is_mountable.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_pt_is_mountable(&mut self, v: bool) {
|
||||||
|
self.pt_is_mountable = ::std::option::Option::Some(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
// required bool pt_has_correct_cap = 2;
|
||||||
|
|
||||||
|
pub fn pt_has_correct_cap(&self) -> bool {
|
||||||
|
self.pt_has_correct_cap.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_pt_has_correct_cap(&mut self) {
|
||||||
|
self.pt_has_correct_cap = ::std::option::Option::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_pt_has_correct_cap(&self) -> bool {
|
||||||
|
self.pt_has_correct_cap.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_pt_has_correct_cap(&mut self, v: bool) {
|
||||||
|
self.pt_has_correct_cap = ::std::option::Option::Some(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
// required bool pt_readme_present = 3;
|
||||||
|
|
||||||
|
pub fn pt_readme_present(&self) -> bool {
|
||||||
|
self.pt_readme_present.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_pt_readme_present(&mut self) {
|
||||||
|
self.pt_readme_present = ::std::option::Option::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_pt_readme_present(&self) -> bool {
|
||||||
|
self.pt_readme_present.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_pt_readme_present(&mut self, v: bool) {
|
||||||
|
self.pt_readme_present = ::std::option::Option::Some(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
// required bool pt_readme_content = 4;
|
||||||
|
|
||||||
|
pub fn pt_readme_content(&self) -> bool {
|
||||||
|
self.pt_readme_content.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_pt_readme_content(&mut self) {
|
||||||
|
self.pt_readme_content = ::std::option::Option::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_pt_readme_content(&self) -> bool {
|
||||||
|
self.pt_readme_content.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_pt_readme_content(&mut self, v: bool) {
|
||||||
|
self.pt_readme_content = ::std::option::Option::Some(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
// required uint32 unalloc_seed_corrupt = 5;
|
||||||
|
|
||||||
|
pub fn unalloc_seed_corrupt(&self) -> u32 {
|
||||||
|
self.unalloc_seed_corrupt.unwrap_or(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_unalloc_seed_corrupt(&mut self) {
|
||||||
|
self.unalloc_seed_corrupt = ::std::option::Option::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_unalloc_seed_corrupt(&self) -> bool {
|
||||||
|
self.unalloc_seed_corrupt.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_unalloc_seed_corrupt(&mut self, v: u32) {
|
||||||
|
self.unalloc_seed_corrupt = ::std::option::Option::Some(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
||||||
|
let mut fields = ::std::vec::Vec::with_capacity(5);
|
||||||
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
||||||
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
||||||
|
"pt_is_mountable",
|
||||||
|
|m: &SdCardBackupHealth| { &m.pt_is_mountable },
|
||||||
|
|m: &mut SdCardBackupHealth| { &mut m.pt_is_mountable },
|
||||||
|
));
|
||||||
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
||||||
|
"pt_has_correct_cap",
|
||||||
|
|m: &SdCardBackupHealth| { &m.pt_has_correct_cap },
|
||||||
|
|m: &mut SdCardBackupHealth| { &mut m.pt_has_correct_cap },
|
||||||
|
));
|
||||||
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
||||||
|
"pt_readme_present",
|
||||||
|
|m: &SdCardBackupHealth| { &m.pt_readme_present },
|
||||||
|
|m: &mut SdCardBackupHealth| { &mut m.pt_readme_present },
|
||||||
|
));
|
||||||
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
||||||
|
"pt_readme_content",
|
||||||
|
|m: &SdCardBackupHealth| { &m.pt_readme_content },
|
||||||
|
|m: &mut SdCardBackupHealth| { &mut m.pt_readme_content },
|
||||||
|
));
|
||||||
|
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
|
||||||
|
"unalloc_seed_corrupt",
|
||||||
|
|m: &SdCardBackupHealth| { &m.unalloc_seed_corrupt },
|
||||||
|
|m: &mut SdCardBackupHealth| { &mut m.unalloc_seed_corrupt },
|
||||||
|
));
|
||||||
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SdCardBackupHealth>(
|
||||||
|
"SdCardBackupHealth",
|
||||||
|
fields,
|
||||||
|
oneofs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::Message for SdCardBackupHealth {
|
||||||
|
const NAME: &'static str = "SdCardBackupHealth";
|
||||||
|
|
||||||
|
fn is_initialized(&self) -> bool {
|
||||||
|
if self.pt_is_mountable.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if self.pt_has_correct_cap.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if self.pt_readme_present.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if self.pt_readme_content.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if self.unalloc_seed_corrupt.is_none() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
||||||
|
match tag {
|
||||||
|
8 => {
|
||||||
|
self.pt_is_mountable = ::std::option::Option::Some(is.read_bool()?);
|
||||||
|
},
|
||||||
|
16 => {
|
||||||
|
self.pt_has_correct_cap = ::std::option::Option::Some(is.read_bool()?);
|
||||||
|
},
|
||||||
|
24 => {
|
||||||
|
self.pt_readme_present = ::std::option::Option::Some(is.read_bool()?);
|
||||||
|
},
|
||||||
|
32 => {
|
||||||
|
self.pt_readme_content = ::std::option::Option::Some(is.read_bool()?);
|
||||||
|
},
|
||||||
|
40 => {
|
||||||
|
self.unalloc_seed_corrupt = ::std::option::Option::Some(is.read_uint32()?);
|
||||||
|
},
|
||||||
|
tag => {
|
||||||
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute sizes of nested messages
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn compute_size(&self) -> u64 {
|
||||||
|
let mut my_size = 0;
|
||||||
|
if let Some(v) = self.pt_is_mountable {
|
||||||
|
my_size += 1 + 1;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_has_correct_cap {
|
||||||
|
my_size += 1 + 1;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_readme_present {
|
||||||
|
my_size += 1 + 1;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_readme_content {
|
||||||
|
my_size += 1 + 1;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.unalloc_seed_corrupt {
|
||||||
|
my_size += ::protobuf::rt::uint32_size(5, v);
|
||||||
|
}
|
||||||
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
||||||
|
self.special_fields.cached_size().set(my_size as u32);
|
||||||
|
my_size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
if let Some(v) = self.pt_is_mountable {
|
||||||
|
os.write_bool(1, v)?;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_has_correct_cap {
|
||||||
|
os.write_bool(2, v)?;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_readme_present {
|
||||||
|
os.write_bool(3, v)?;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.pt_readme_content {
|
||||||
|
os.write_bool(4, v)?;
|
||||||
|
}
|
||||||
|
if let Some(v) = self.unalloc_seed_corrupt {
|
||||||
|
os.write_uint32(5, v)?;
|
||||||
|
}
|
||||||
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
||||||
|
&self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
||||||
|
&mut self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new() -> SdCardBackupHealth {
|
||||||
|
SdCardBackupHealth::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.pt_is_mountable = ::std::option::Option::None;
|
||||||
|
self.pt_has_correct_cap = ::std::option::Option::None;
|
||||||
|
self.pt_readme_present = ::std::option::Option::None;
|
||||||
|
self.pt_readme_content = ::std::option::Option::None;
|
||||||
|
self.unalloc_seed_corrupt = ::std::option::Option::None;
|
||||||
|
self.special_fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_instance() -> &'static SdCardBackupHealth {
|
||||||
|
static instance: SdCardBackupHealth = SdCardBackupHealth {
|
||||||
|
pt_is_mountable: ::std::option::Option::None,
|
||||||
|
pt_has_correct_cap: ::std::option::Option::None,
|
||||||
|
pt_readme_present: ::std::option::Option::None,
|
||||||
|
pt_readme_content: ::std::option::Option::None,
|
||||||
|
unalloc_seed_corrupt: ::std::option::Option::None,
|
||||||
|
special_fields: ::protobuf::SpecialFields::new(),
|
||||||
|
};
|
||||||
|
&instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::MessageFull for SdCardBackupHealth {
|
||||||
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
||||||
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("SdCardBackupHealth").unwrap()).clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::std::fmt::Display for SdCardBackupHealth {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::protobuf::text_format::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::reflect::ProtobufValue for SdCardBackupHealth {
|
||||||
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(message:hw.trezor.messages.sdbackup.SdCardBackupRefreshRequest)
|
||||||
|
#[derive(PartialEq,Clone,Default,Debug)]
|
||||||
|
pub struct SdCardBackupRefreshRequest {
|
||||||
|
// special fields
|
||||||
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.sdbackup.SdCardBackupRefreshRequest.special_fields)
|
||||||
|
pub special_fields: ::protobuf::SpecialFields,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> ::std::default::Default for &'a SdCardBackupRefreshRequest {
|
||||||
|
fn default() -> &'a SdCardBackupRefreshRequest {
|
||||||
|
<SdCardBackupRefreshRequest as ::protobuf::Message>::default_instance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SdCardBackupRefreshRequest {
|
||||||
|
pub fn new() -> SdCardBackupRefreshRequest {
|
||||||
|
::std::default::Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
||||||
|
let mut fields = ::std::vec::Vec::with_capacity(0);
|
||||||
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
||||||
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SdCardBackupRefreshRequest>(
|
||||||
|
"SdCardBackupRefreshRequest",
|
||||||
|
fields,
|
||||||
|
oneofs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::Message for SdCardBackupRefreshRequest {
|
||||||
|
const NAME: &'static str = "SdCardBackupRefreshRequest";
|
||||||
|
|
||||||
|
fn is_initialized(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
||||||
|
match tag {
|
||||||
|
tag => {
|
||||||
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute sizes of nested messages
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn compute_size(&self) -> u64 {
|
||||||
|
let mut my_size = 0;
|
||||||
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
||||||
|
self.special_fields.cached_size().set(my_size as u32);
|
||||||
|
my_size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
||||||
|
&self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
||||||
|
&mut self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new() -> SdCardBackupRefreshRequest {
|
||||||
|
SdCardBackupRefreshRequest::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.special_fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_instance() -> &'static SdCardBackupRefreshRequest {
|
||||||
|
static instance: SdCardBackupRefreshRequest = SdCardBackupRefreshRequest {
|
||||||
|
special_fields: ::protobuf::SpecialFields::new(),
|
||||||
|
};
|
||||||
|
&instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::MessageFull for SdCardBackupRefreshRequest {
|
||||||
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
||||||
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("SdCardBackupRefreshRequest").unwrap()).clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::std::fmt::Display for SdCardBackupRefreshRequest {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::protobuf::text_format::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::reflect::ProtobufValue for SdCardBackupRefreshRequest {
|
||||||
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(message:hw.trezor.messages.sdbackup.SdCardBackupWipeRequest)
|
||||||
|
#[derive(PartialEq,Clone,Default,Debug)]
|
||||||
|
pub struct SdCardBackupWipeRequest {
|
||||||
|
// special fields
|
||||||
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.sdbackup.SdCardBackupWipeRequest.special_fields)
|
||||||
|
pub special_fields: ::protobuf::SpecialFields,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> ::std::default::Default for &'a SdCardBackupWipeRequest {
|
||||||
|
fn default() -> &'a SdCardBackupWipeRequest {
|
||||||
|
<SdCardBackupWipeRequest as ::protobuf::Message>::default_instance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SdCardBackupWipeRequest {
|
||||||
|
pub fn new() -> SdCardBackupWipeRequest {
|
||||||
|
::std::default::Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
||||||
|
let mut fields = ::std::vec::Vec::with_capacity(0);
|
||||||
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
||||||
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SdCardBackupWipeRequest>(
|
||||||
|
"SdCardBackupWipeRequest",
|
||||||
|
fields,
|
||||||
|
oneofs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::Message for SdCardBackupWipeRequest {
|
||||||
|
const NAME: &'static str = "SdCardBackupWipeRequest";
|
||||||
|
|
||||||
|
fn is_initialized(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
||||||
|
match tag {
|
||||||
|
tag => {
|
||||||
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute sizes of nested messages
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn compute_size(&self) -> u64 {
|
||||||
|
let mut my_size = 0;
|
||||||
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
||||||
|
self.special_fields.cached_size().set(my_size as u32);
|
||||||
|
my_size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
||||||
|
&self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
||||||
|
&mut self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new() -> SdCardBackupWipeRequest {
|
||||||
|
SdCardBackupWipeRequest::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.special_fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_instance() -> &'static SdCardBackupWipeRequest {
|
||||||
|
static instance: SdCardBackupWipeRequest = SdCardBackupWipeRequest {
|
||||||
|
special_fields: ::protobuf::SpecialFields::new(),
|
||||||
|
};
|
||||||
|
&instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::MessageFull for SdCardBackupWipeRequest {
|
||||||
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
||||||
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("SdCardBackupWipeRequest").unwrap()).clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::std::fmt::Display for SdCardBackupWipeRequest {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::protobuf::text_format::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::reflect::ProtobufValue for SdCardBackupWipeRequest {
|
||||||
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(message:hw.trezor.messages.sdbackup.SdCardBackupCopyRequest)
|
||||||
|
#[derive(PartialEq,Clone,Default,Debug)]
|
||||||
|
pub struct SdCardBackupCopyRequest {
|
||||||
|
// special fields
|
||||||
|
// @@protoc_insertion_point(special_field:hw.trezor.messages.sdbackup.SdCardBackupCopyRequest.special_fields)
|
||||||
|
pub special_fields: ::protobuf::SpecialFields,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> ::std::default::Default for &'a SdCardBackupCopyRequest {
|
||||||
|
fn default() -> &'a SdCardBackupCopyRequest {
|
||||||
|
<SdCardBackupCopyRequest as ::protobuf::Message>::default_instance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SdCardBackupCopyRequest {
|
||||||
|
pub fn new() -> SdCardBackupCopyRequest {
|
||||||
|
::std::default::Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
|
||||||
|
let mut fields = ::std::vec::Vec::with_capacity(0);
|
||||||
|
let mut oneofs = ::std::vec::Vec::with_capacity(0);
|
||||||
|
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<SdCardBackupCopyRequest>(
|
||||||
|
"SdCardBackupCopyRequest",
|
||||||
|
fields,
|
||||||
|
oneofs,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::Message for SdCardBackupCopyRequest {
|
||||||
|
const NAME: &'static str = "SdCardBackupCopyRequest";
|
||||||
|
|
||||||
|
fn is_initialized(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
while let Some(tag) = is.read_raw_tag_or_eof()? {
|
||||||
|
match tag {
|
||||||
|
tag => {
|
||||||
|
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute sizes of nested messages
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
fn compute_size(&self) -> u64 {
|
||||||
|
let mut my_size = 0;
|
||||||
|
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
|
||||||
|
self.special_fields.cached_size().set(my_size as u32);
|
||||||
|
my_size
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
|
||||||
|
os.write_unknown_fields(self.special_fields.unknown_fields())?;
|
||||||
|
::std::result::Result::Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn special_fields(&self) -> &::protobuf::SpecialFields {
|
||||||
|
&self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
|
||||||
|
&mut self.special_fields
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new() -> SdCardBackupCopyRequest {
|
||||||
|
SdCardBackupCopyRequest::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn clear(&mut self) {
|
||||||
|
self.special_fields.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_instance() -> &'static SdCardBackupCopyRequest {
|
||||||
|
static instance: SdCardBackupCopyRequest = SdCardBackupCopyRequest {
|
||||||
|
special_fields: ::protobuf::SpecialFields::new(),
|
||||||
|
};
|
||||||
|
&instance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::MessageFull for SdCardBackupCopyRequest {
|
||||||
|
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
|
||||||
|
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
descriptor.get(|| file_descriptor().message_by_package_relative_name("SdCardBackupCopyRequest").unwrap()).clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::std::fmt::Display for SdCardBackupCopyRequest {
|
||||||
|
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||||
|
::protobuf::text_format::fmt(self, f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ::protobuf::reflect::ProtobufValue for SdCardBackupCopyRequest {
|
||||||
|
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
|
||||||
|
}
|
||||||
|
|
||||||
|
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||||
|
\n\x17messages-sdbackup.proto\x12\x1bhw.trezor.messages.sdbackup\x1a\x0e\
|
||||||
|
messages.proto\"\x20\n\x1eSdCardBackupCheckHealthRequest\"\xf3\x01\n\x12\
|
||||||
|
SdCardBackupHealth\x12&\n\x0fpt_is_mountable\x18\x01\x20\x02(\x08R\rptIs\
|
||||||
|
Mountable\x12+\n\x12pt_has_correct_cap\x18\x02\x20\x02(\x08R\x0fptHasCor\
|
||||||
|
rectCap\x12*\n\x11pt_readme_present\x18\x03\x20\x02(\x08R\x0fptReadmePre\
|
||||||
|
sent\x12*\n\x11pt_readme_content\x18\x04\x20\x02(\x08R\x0fptReadmeConten\
|
||||||
|
t\x120\n\x14unalloc_seed_corrupt\x18\x05\x20\x02(\rR\x12unallocSeedCorru\
|
||||||
|
pt\"\x1c\n\x1aSdCardBackupRefreshRequest\"\x19\n\x17SdCardBackupWipeRequ\
|
||||||
|
est\"\x19\n\x17SdCardBackupCopyRequestB<\n#com.satoshilabs.trezor.lib.pr\
|
||||||
|
otobufB\x15TrezorMessageSdbackup\
|
||||||
|
";
|
||||||
|
|
||||||
|
/// `FileDescriptorProto` object which was a source for this generated file
|
||||||
|
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
|
||||||
|
static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
|
||||||
|
file_descriptor_proto_lazy.get(|| {
|
||||||
|
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `FileDescriptor` object which allows dynamic access to files
|
||||||
|
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
|
||||||
|
static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
|
||||||
|
file_descriptor.get(|| {
|
||||||
|
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
|
||||||
|
let mut deps = ::std::vec::Vec::with_capacity(1);
|
||||||
|
deps.push(super::messages::file_descriptor().clone());
|
||||||
|
let mut messages = ::std::vec::Vec::with_capacity(5);
|
||||||
|
messages.push(SdCardBackupCheckHealthRequest::generated_message_descriptor_data());
|
||||||
|
messages.push(SdCardBackupHealth::generated_message_descriptor_data());
|
||||||
|
messages.push(SdCardBackupRefreshRequest::generated_message_descriptor_data());
|
||||||
|
messages.push(SdCardBackupWipeRequest::generated_message_descriptor_data());
|
||||||
|
messages.push(SdCardBackupCopyRequest::generated_message_descriptor_data());
|
||||||
|
let mut enums = ::std::vec::Vec::with_capacity(0);
|
||||||
|
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
|
||||||
|
file_descriptor_proto(),
|
||||||
|
deps,
|
||||||
|
messages,
|
||||||
|
enums,
|
||||||
|
)
|
||||||
|
});
|
||||||
|
::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in new issue