pelf 0.1.5

A library for parsing/generating/analyzing ELF
Documentation
use crate::prelude::*;

/// the builder of [super::RawElf64SectionHeader].
#[derive(Default, Debug)]
pub struct RawElf64SectionHeaderBuilder {
    inner: super::RawElf64SectionHeader,
}

impl RawElf64SectionHeaderBuilder {
    /// set the given sh_name into itself for building.
    pub fn name(mut self, sh_name: Elf64Word) -> Self {
        self.inner.sh_name = sh_name;
        self
    }

    /// set the given sh_type into itself for building.
    pub fn section_type(mut self, sh_type: Elf64Word) -> Self {
        self.inner.sh_type = sh_type;
        self
    }

    /// set the given sh_flags into itself for building.
    pub fn flags(mut self, sh_flags: Elf64Xword) -> Self {
        self.inner.sh_flags = sh_flags;
        self
    }

    /// set the given sh_addr into itself for building.
    pub fn addr(mut self, sh_addr: Elf64Addr) -> Self {
        self.inner.sh_addr = sh_addr;
        self
    }

    /// set the given sh_offset into itself for building.
    pub fn offset(mut self, sh_offset: Elf64Off) -> Self {
        self.inner.sh_offset = sh_offset;
        self
    }

    /// set the given sh_size into itself for building.
    pub fn size(mut self, sh_size: Elf64Xword) -> Self {
        self.inner.sh_size = sh_size;
        self
    }

    /// set the given sh_link into itself for building.
    pub fn link(mut self, sh_link: Elf64Word) -> Self {
        self.inner.sh_link = sh_link;
        self
    }

    /// set the given sh_info into itself for building.
    pub fn info(mut self, sh_info: Elf64Word) -> Self {
        self.inner.sh_info = sh_info;
        self
    }

    /// set the given sh_addralign into itself for building.
    pub fn addralign(mut self, sh_addralign: Elf64Xword) -> Self {
        self.inner.sh_addralign = sh_addralign;
        self
    }

    /// set the given sh_entsize into itself for building.
    pub fn entsize(mut self, sh_entsize: Elf64Xword) -> Self {
        self.inner.sh_entsize = sh_entsize;
        self
    }

    pub fn build(self) -> super::RawElf64SectionHeader {
        self.inner
    }
}