Struct debian_control::control::Control

source ·
pub struct Control(/* private fields */);

Implementations§

source§

impl Control

source

pub fn new() -> Self

Examples found in repository?
examples/create-file.rs (line 4)
3
4
5
6
7
8
9
10
11
12
13
14
pub fn main() {
    let mut control = Control::new();
    let mut source = control.add_source("hello");
    source.set_section("rust");

    let mut binary = control.add_binary("hello");
    binary.set_architecture("amd64");
    binary.set_priority(Priority::Optional);
    binary.set_description("Hello, world!");

    println!("{}", control.to_string());
}
source

pub fn source(&self) -> Option<Source>

source

pub fn binaries(&self) -> impl Iterator<Item = Binary>

source

pub fn add_source(&mut self, name: &str) -> Source

Examples found in repository?
examples/create-file.rs (line 5)
3
4
5
6
7
8
9
10
11
12
13
14
pub fn main() {
    let mut control = Control::new();
    let mut source = control.add_source("hello");
    source.set_section("rust");

    let mut binary = control.add_binary("hello");
    binary.set_architecture("amd64");
    binary.set_priority(Priority::Optional);
    binary.set_description("Hello, world!");

    println!("{}", control.to_string());
}
source

pub fn add_binary(&mut self, name: &str) -> Binary

Examples found in repository?
examples/create-file.rs (line 8)
3
4
5
6
7
8
9
10
11
12
13
14
pub fn main() {
    let mut control = Control::new();
    let mut source = control.add_source("hello");
    source.set_section("rust");

    let mut binary = control.add_binary("hello");
    binary.set_architecture("amd64");
    binary.set_priority(Priority::Optional);
    binary.set_description("Hello, world!");

    println!("{}", control.to_string());
}
source

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>

source

pub fn from_file_relaxed<P: AsRef<Path>>( path: P, ) -> Result<(Self, Vec<String>), Error>

source

pub fn read<R: Read>(r: R) -> Result<Self, Error>

source

pub fn read_relaxed<R: Read>(r: R) -> Result<(Self, Vec<String>), Error>

Trait Implementations§

source§

impl Default for Control

source§

fn default() -> Self

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

impl Display for Control

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for Control

§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

§

impl Freeze for Control

§

impl !RefUnwindSafe for Control

§

impl !Send for Control

§

impl !Sync for Control

§

impl Unpin for Control

§

impl !UnwindSafe for Control

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.