Trait oracle::sql_type::Lob

source ·
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§

source

fn size(&self) -> Result<u64>

Returns the size of the data stored in the LOB.

Note: For Clob the size is in number of UCS-2 codepoints; for Blob the size is in bytes.

source

fn truncate(&mut self, new_size: u64) -> Result<()>

Shortens the data in the LOB so that it only contains the specified amount of data.

Note: For Clob the size is in number of UCS-2 codepoints; for Blob the size is in bytes.

source

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.

source

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.

source

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.

source

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.

Implementors§