Struct mimir::Lob [−][src]
pub struct Lob { /* fields omitted */ }
LOB handles are used to represent large objects (CLOB, BLOB, NCLOB, BFILE).
Methods
impl Lob
[src]
impl Lob
pub fn close_resource(&self) -> Result<()>
[src]
pub fn close_resource(&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 Lob::open_resource()
has been performed.
pub fn copy(&self, dst: &mut Self) -> Result<()>
[src]
pub fn copy(&self, dst: &mut Self) -> Result<()>
Creates an independent copy of a LOB and returns a reference to the newly created LOB. This reference should be released as soon as it is no longer needed.
pub fn flush_buffer(&self) -> Result<()>
[src]
pub fn flush_buffer(&self) -> Result<()>
Flush or write all buffers for this LOB to the server.
pub fn get_buffer_size(&self, size_in_chars: u64) -> Result<u64>
[src]
pub fn get_buffer_size(&self, size_in_chars: u64) -> Result<u64>
Returns the size of the buffer needed to hold the number of characters specified for a buffer of the type associated with the LOB. If the LOB does not refer to a character LOB the value is returned unchanged.
size_in_chars
- the number of characters for which a buffer size needs to be determined.
pub fn get_chunk_size(&self) -> Result<u32>
[src]
pub fn get_chunk_size(&self) -> Result<u32>
Returns the chunk size of the internal LOB. Reading and writing to the LOB in multiples of this size will improve performance.
pub fn get_directory_and_filename(&self) -> Result<(String, String)>
[src]
pub fn get_directory_and_filename(&self) -> Result<(String, String)>
Returns the directory alias name and file name for a BFILE type LOB.
Returns a (String, String)
tuple representing the directory alias and filename.
pub fn get_file_exists(&self) -> Result<bool>
[src]
pub fn get_file_exists(&self) -> Result<bool>
Returns a bool value indicating if the file referenced by the BFILE type LOB exists.
pub fn get_is_resource_open(&self) -> Result<bool>
[src]
pub fn get_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 Lob::open_resource() or not.
pub fn get_size(&self) -> Result<u64>
[src]
pub fn get_size(&self) -> Result<u64>
Returns the size of the data stored in the LOB. For character LOBs the size is in characters; for binary LOBs the size is in bytes.
pub fn open_resource(&self) -> Result<()>
[src]
pub fn open_resource(&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 function Lob::close_resource()
should be done before performing a
call to the function Connection::commit()
.
pub fn read_bytes(&self, offset: u64, length: u64) -> Result<Vec<i8>>
[src]
pub fn read_bytes(&self, offset: u64, length: u64) -> Result<Vec<i8>>
Reads data from the LOB at the specified offset into the provided buffer.
pub fn set_directory_and_filename(
&self,
directory: &str,
filename: &str
) -> Result<()>
[src]
pub fn set_directory_and_filename(
&self,
directory: &str,
filename: &str
) -> Result<()>
Sets the directory alias name and file name for a BFILE type LOB.
directory
- the name of the directory alias.filename
- the name of the file.
pub fn set_from_bytes(&self, buffer: &[i8]) -> Result<()>
[src]
pub fn set_from_bytes(&self, buffer: &[i8]) -> Result<()>
Replaces all of the data in the LOB with the contents of the provided buffer. The LOB will first be cleared and then the provided data will be written.
buffer
- the buffer from which the data is written.
pub fn trim(&self, length: u64) -> Result<()>
[src]
pub fn trim(&self, length: u64) -> Result<()>
Trims the data in the LOB so that it only contains the specified amount of data.
length
- the new size of the data in the LOB. For character LOBs this value is in characters; for binary LOBs this value is in bytes.
pub fn write_bytes(&self, buffer: &[i8], offset: u64) -> Result<()>
[src]
pub fn write_bytes(&self, buffer: &[i8], offset: u64) -> Result<()>
Write data to the LOB at the specified offset using the provided buffer as the source. If multiple calls to this function are planned, the LOB should first be opened using the function Lob::open_resource().
buffer
- the buffer from which the data is written.offset
- the offset into the LOB data from which to start writing. The first position is
- For character LOBs this represents the number of characters from the beginning of the LOB; for binary LOBS, this represents the number of bytes from the beginning of the LOB.