QBDeletable

Trait QBDeletable 

Source
pub trait QBDeletable: QBItem {
    // Provided method
    fn can_delete(&self) -> bool { ... }
}
Expand description

Trait for entities that can be deleted from QuickBooks.

This trait is automatically implemented for all QBItem types and provides validation for delete operations. Entities must have been read from QuickBooks (have both ID and sync token) to be deletable.

§Default Implementation

The default implementation uses QBItem::has_read() to verify the entity has both an ID and sync token, which are required for delete operations.

§Examples

use quickbooks_types::{Invoice, QBDeletable};

let mut invoice = Invoice::default();
invoice.id = Some("123".to_string());
invoice.sync_token = Some("2".to_string());

// Can delete because it has both ID and sync token
assert!(invoice.can_delete());

Provided Methods§

Source

fn can_delete(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§