pub trait Lob {
// Required methods
fn size(&self) -> Result<u64>;
fn truncate(&mut self, new_size: u64) -> Result<()>;
fn chunk_size(&self) -> Result<usize>;
fn open_resource(&mut self) -> Result<()>;
fn close_resource(&mut self) -> Result<()>;
fn is_resource_open(&self) -> Result<bool>;
}
Expand description
A trait for LOB types
Required Methods§
Sourcefn chunk_size(&self) -> Result<usize>
fn chunk_size(&self) -> Result<usize>
Returns the chunk size, in bytes, of the internal LOB. Reading and writing to the LOB in multiples of this size will improve performance.
Sourcefn open_resource(&mut self) -> Result<()>
fn open_resource(&mut self) -> Result<()>
Opens the LOB resource for writing. This will improve performance when
writing to the LOB in chunks and there are functional or extensible indexes
associated with the LOB. If this function is not called, the LOB resource
will be opened and closed for each write that is performed. A call to the
close_resource
should be done before performing a
call to the function Connection.commit
.
Sourcefn close_resource(&mut self) -> Result<()>
fn close_resource(&mut self) -> Result<()>
Closes the LOB resource. This should be done when a batch of writes has
been completed so that the indexes associated with the LOB can be updated.
It should only be performed if a call to function
open_resource
has been performed.
Sourcefn is_resource_open(&self) -> Result<bool>
fn is_resource_open(&self) -> Result<bool>
Returns a boolean value indicating if the LOB resource has been opened by
making a call to the function open_resource
.