[][src]Struct dsf_core::wire::builder::Builder

pub struct Builder<S, T: MutableData> { /* fields omitted */ }

Builder provides a low-level wire protocol builder object. This is generic over buffer types and uses type-state mutation to ensure created objects are valid

Implementations

impl<S, T: MutableData> Builder<S, T>[src]

pub fn id(mut self: Self, id: &Id) -> Self[src]

Set the object id

pub fn header_mut(&mut self) -> WireHeader<&mut [u8]>[src]

Fetch a mutable instance of the object header

impl<T: MutableData> Builder<Init, T>[src]

pub fn new(buf: T) -> Self[src]

Create a new base builder object

pub fn header(mut self: Self, header: &Header) -> Self[src]

Set the object header. Note that length fields will be overwritten by actual lengths

pub fn body<B: ImmutableData>(
    mut self: Self,
    body: &NewBody<B>,
    secret_key: Option<&SecretKey>
) -> Result<Builder<SetPrivateOptions, T>, Error>
[src]

Add body data, mutating the state of the builder

impl<T: MutableData> Builder<SetPrivateOptions, T>[src]

pub fn private_options<C: AsRef<[Options]>, E: ImmutableData>(
    mut self: Self,
    options: &OptionsList<C, E>,
    secret_key: Option<&SecretKey>
) -> Result<Builder<SetPublicOptions, T>, Error>
[src]

Encode private options This must be done in one pass as the entire options block is encrypted

impl<T: MutableData> Builder<SetPublicOptions, T>[src]

pub fn public_options<C: AsRef<[Options]>, E: ImmutableData>(
    mut self: Self,
    options: &OptionsList<C, E>
) -> Result<Builder<SetPublicOptions, T>, Error>
[src]

Encode a list of public options

pub fn public_option(&mut self, option: &Options) -> Result<(), Error>[src]

Add a single public option

pub fn sign(
    mut self: Self,
    signing_key: &PrivateKey
) -> Result<Container<T>, Error>
[src]

Auto Trait Implementations

impl<S, T> RefUnwindSafe for Builder<S, T> where
    S: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<S, T> Send for Builder<S, T> where
    S: Send,
    T: Send
[src]

impl<S, T> Sync for Builder<S, T> where
    S: Sync,
    T: Sync
[src]

impl<S, T> Unpin for Builder<S, T> where
    S: Unpin,
    T: Unpin
[src]

impl<S, T> UnwindSafe for Builder<S, T> where
    S: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.