Struct gdal::DriverManager

source ·
pub struct DriverManager;
Expand description

A wrapper around GDALDriverManager. This struct helps listing and registering Drivers.

Implementations§

source§

impl DriverManager

source

pub fn count() -> usize

Returns the number of registered drivers.

Example
use gdal::DriverManager;
println!("{} drivers are registered", DriverManager::count());
203 drivers are registered
source

pub fn get_driver(index: usize) -> Result<Driver>

Returns the driver with the given index, which must be less than the value returned by DriverManager::count().

See also: count

Example
use gdal::DriverManager;
assert!(DriverManager::count() > 0);
let d = DriverManager::get_driver(0)?;
println!("'{}' is '{}'", d.short_name(), d.long_name());
'VRT' is 'Virtual Raster'
source

pub fn get_driver_by_name(name: &str) -> Result<Driver>

Returns the driver with the given short name or Err if not found.

See also: count, get

Example
use gdal::DriverManager;
let cog_driver = DriverManager::get_driver_by_name("COG")?;
println!("{}", cog_driver.long_name());
Cloud optimized GeoTIFF generator
source

pub fn register_driver(driver: &Driver) -> usize

Register a driver for use.

Wraps GDALRegisterDriver()

source

pub fn deregister_driver(driver: &Driver)

Deregister the passed driver.

Wraps GDALDeregisterDriver()

source

pub fn register_all()

Register all known GDAL drivers.

Wraps GDALAllRegister()

source

pub fn prevent_auto_registration()

Prevents the automatic registration of all known GDAL drivers when first calling create, open, etc.

source

pub fn destroy()

Destroys the driver manager, i.e., unloads all drivers.

Wraps GDALDestroyDriverManager()

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.