pub struct VipsSource { /* private fields */ }Implementations§
Source§impl VipsSource
impl VipsSource
Sourcepub fn new_from_descriptor(descriptor: i32) -> Result<Self>
pub fn new_from_descriptor(descriptor: i32) -> Result<Self>
Create an source attached to a file descriptor. descriptor is closed with close() when source is finalized.
Sourcepub fn new_from_file(filename: &str) -> Result<Self>
pub fn new_from_file(filename: &str) -> Result<Self>
Create a source attached to a file.
Sourcepub fn new_from_memory(buffer: &[u8]) -> Result<Self>
pub fn new_from_memory(buffer: &[u8]) -> Result<Self>
Create a source attached to an area of memory. You must not free data while the source is active.
Sourcepub fn new_from_options(option_str: &str) -> Result<Self>
pub fn new_from_options(option_str: &str) -> Result<Self>
Create a source from an option string.
Sourcepub fn minimise(&mut self)
pub fn minimise(&mut self)
Minimise the source. As many resources as can be safely removed are removed.
Sourcepub fn unminimise(&mut self) -> Result<()>
pub fn unminimise(&mut self) -> Result<()>
Restore the source after minimisation. This is called at the start of every source method, so loaders should not usually need this.
Sourcepub fn decode(&mut self) -> Result<()>
pub fn decode(&mut self) -> Result<()>
Signal the end of header read and the start of the pixel decode phase. After this, you can no longer seek on this source.
Sourcepub fn read(&mut self, length: u64) -> Result<Vec<u8>>
pub fn read(&mut self, length: u64) -> Result<Vec<u8>>
Read up to length bytes from source and store the bytes in buffer.
Sourcepub fn is_mappable(&self) -> bool
pub fn is_mappable(&self) -> bool
Whether the source can be efficiently mapped into memory.
Trait Implementations§
Source§impl Clone for VipsSource
impl Clone for VipsSource
Source§fn clone(&self) -> VipsSource
fn clone(&self) -> VipsSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VipsSource
impl Debug for VipsSource
Source§impl Drop for VipsSource
impl Drop for VipsSource
Source§impl From<*mut _VipsSource> for VipsSource
impl From<*mut _VipsSource> for VipsSource
Source§fn from(value: *mut VipsSource) -> Self
fn from(value: *mut VipsSource) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VipsSource
impl RefUnwindSafe for VipsSource
impl !Send for VipsSource
impl !Sync for VipsSource
impl Unpin for VipsSource
impl UnwindSafe for VipsSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more