Trait maturin::ModuleWriter

source ·
pub trait ModuleWriter {
    // Required methods
    fn add_directory(&mut self, path: impl AsRef<Path>) -> Result<()>;
    fn add_bytes_with_permissions(
        &mut self,
        target: impl AsRef<Path>,
        bytes: &[u8],
        permissions: u32
    ) -> Result<()>;

    // Provided methods
    fn add_bytes(
        &mut self,
        target: impl AsRef<Path>,
        bytes: &[u8]
    ) -> Result<()> { ... }
    fn add_file(
        &mut self,
        target: impl AsRef<Path>,
        source: impl AsRef<Path>
    ) -> Result<()> { ... }
    fn add_file_with_permissions(
        &mut self,
        target: impl AsRef<Path>,
        source: impl AsRef<Path>,
        permissions: u32
    ) -> Result<()> { ... }
}
Expand description

Allows writing the module to a wheel or add it directly to the virtualenv

Required Methods§

source

fn add_directory(&mut self, path: impl AsRef<Path>) -> Result<()>

Adds a directory relative to the module base path

source

fn add_bytes_with_permissions( &mut self, target: impl AsRef<Path>, bytes: &[u8], permissions: u32 ) -> Result<()>

Adds a file with bytes as content in target relative to the module base path while setting the given unix permissions

Provided Methods§

source

fn add_bytes(&mut self, target: impl AsRef<Path>, bytes: &[u8]) -> Result<()>

Adds a file with bytes as content in target relative to the module base path

source

fn add_file( &mut self, target: impl AsRef<Path>, source: impl AsRef<Path> ) -> Result<()>

Copies the source file to the target path relative to the module base path

source

fn add_file_with_permissions( &mut self, target: impl AsRef<Path>, source: impl AsRef<Path>, permissions: u32 ) -> Result<()>

Copies the source file the the target path relative to the module base path while setting the given unix permissions

Object Safety§

This trait is not object safe.

Implementors§