Skip to main content

Build

Struct Build 

Source
pub struct Build { /* private fields */ }
Expand description

Configuration for compiling the bundled Samba source.

Defaults are read from Cargo’s OUT_DIR, TARGET, and HOST environment variables.

Implementations§

Source§

impl Build

Source

pub fn new() -> Build

Creates a build configuration from the current Cargo environment.

Source

pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build

Sets the directory used for cloned sources and build outputs.

Source

pub fn target(&mut self, target: &str) -> &mut Build

Sets the target triple passed to the native toolchain.

Source

pub fn host(&mut self, host: &str) -> &mut Build

Sets the host triple used to select the native make command.

Source

pub fn samba_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build

Stores the intended Samba installation prefix.

The current static-library build does not pass this value to Samba’s configure script.

Source

pub fn gnutls(&mut self, paths: Vec<PathBuf>) -> &mut Build

Sets additional GnuTLS include directories used on macOS.

Source

pub fn build(&mut self) -> Artifacts

Builds Samba and returns the generated artifacts.

Build failures are emitted as Cargo warnings and written to standard error.

§Process termination

Exits the process with status code 1 if the native build fails.

Source

pub fn try_build(&mut self) -> Result<Artifacts, String>

Attempts to build Samba and returns the generated artifacts.

This clones the matching Samba tag, runs its configuration and make steps, and assembles a static libsmbclient archive.

§Errors

Returns an error when required configuration is absent, the target is unsupported, source retrieval fails, filesystem operations fail, or a native build command fails.

Trait Implementations§

Source§

impl Default for Build

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Build

§

impl RefUnwindSafe for Build

§

impl Send for Build

§

impl Sync for Build

§

impl Unpin for Build

§

impl UnsafeUnpin for Build

§

impl UnwindSafe for Build

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.