Skip to main content

RowCopier

Struct RowCopier 

Source
pub struct RowCopier<'a> {
    pub owner_layer: i64,
    pub skip: HashSet<(String, String)>,
    pub new_externals: Vec<(String, Vec<u8>)>,
    /* private fields */
}
Expand description

Copies rows, and everything they link to, from one file’s database to another’s.

Fields§

§owner_layer: i64

The layer id written into layer-owned columns.

§skip: HashSet<(String, String)>

(table, column) values copied unchanged (links not followed).

§new_externals: Vec<(String, Vec<u8>)>

External chunks copied so far, to be stored in the target file.

Implementations§

Source§

impl<'a> RowCopier<'a>

Source

pub fn new( source: &'a ClipFile, payload_hook: Option<&'a PayloadHook<'a>>, canvas_id: i64, ) -> Result<Self>

A copier reading from source. payload_hook rewrites external payloads as they are copied; canvas_id is the target’s Canvas.MainId.

Source

pub fn copy( &mut self, target: &Connection, table: &str, main_id: i64, ) -> Result<i64>

Copy row main_id of table into target; return its id there.

Source

pub fn translate( &mut self, target: &Connection, table: &str, row: Row, new_id: i64, ) -> Result<Row>

Rewrite the id, owner columns, links and external ids of one row.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for RowCopier<'a>

§

impl<'a> !Send for RowCopier<'a>

§

impl<'a> !Sync for RowCopier<'a>

§

impl<'a> !UnwindSafe for RowCopier<'a>

§

impl<'a> Freeze for RowCopier<'a>

§

impl<'a> Unpin for RowCopier<'a>

§

impl<'a> UnsafeUnpin for RowCopier<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.