Struct msi::Package
[−]
[src]
pub struct Package<F> { /* fields omitted */ }
Methods
impl<F> Package<F>
[src]
fn package_type(&self) -> PackageType
Returns what type of package this is.
fn summary_info(&self) -> &SummaryInfo
Returns summary information for this package.
fn database_codepage(&self) -> CodePage
Returns the code page used for serializing strings in the database.
fn has_table(&self, table_name: &str) -> bool
Returns true if the database has a table with the given name.
fn get_table(&self, table_name: &str) -> Option<&Table>
Returns the database table with the given name (if any).
fn tables(&self) -> Tables
Returns an iterator over the database tables in this package.
fn has_stream(&self, stream_name: &str) -> bool
Returns true if the database has an embedded binary stream with the given name.
fn streams(&self) -> Streams
Returns an iterator over the embedded binary streams in this package.
fn into_inner(self) -> Result<F>
Consumes the Package
object, returning the underlying reader/writer.
impl<F: Read + Seek> Package<F>
[src]
fn open(inner: F) -> Result<Package<F>>
Opens an existing MSI file, using the underlying reader. If the
underlying reader also supports the Write
trait, then the Package
object will be writable as well.
fn select_rows(&mut self, query: Select) -> Result<Rows>
Attempts to execute a select query. Returns an error if the query fails (e.g. due to the column names being incorrect or the table(s) not existing).
fn read_stream(&mut self, stream_name: &str) -> Result<StreamReader<F>>
Opens an existing binary stream in the package for reading.
impl<F: Read + Write + Seek> Package<F>
[src]
fn create(package_type: PackageType, inner: F) -> Result<Package<F>>
Creates a new, empty package of the given type, using the underlying reader/writer. The reader/writer should be initially empty.
fn summary_info_mut(&mut self) -> &mut SummaryInfo
Returns a mutable reference to the summary information for this
package. Call flush()
or drop the Package
object to persist any
changes made to the underlying writer.
fn set_database_codepage(&mut self, codepage: CodePage)
Sets the code page used for serializing strings in the database.
fn create_table(
&mut self,
table_name: String,
columns: Vec<Column>
) -> Result<()>
&mut self,
table_name: String,
columns: Vec<Column>
) -> Result<()>
Creates a new database table. Returns an error without modifying the table name or columns are invalid, or if a table with that name already exists.
fn delete_rows(&mut self, query: Delete) -> Result<()>
Attempts to execute a delete query. Returns an error without modifying the database if the query fails (e.g. due to the table not existing).
fn insert_rows(&mut self, query: Insert) -> Result<()>
Attempts to execute an insert query. Returns an error without modifying the database if the query fails (e.g. due to values being invalid, or keys not being unique, or the table not existing).
fn update_rows(&mut self, query: Update) -> Result<()>
Attempts to execute an update query. Returns an error without modifying the database if the query fails (e.g. due to values being invalid, or column names being incorrect, or the table not existing).
fn write_stream(&mut self, stream_name: &str) -> Result<StreamWriter<F>>
Creates (or overwrites) a binary stream in the package.
fn flush(&mut self) -> Result<()>
Flushes any buffered changes to the underlying writer.