[−][src]Struct dsf_core::wire::builder::Builder
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(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(self, header: &Header) -> Self[src]
Set the object header. Note that length fields will be overwritten by actual lengths
pub fn body<B: ImmutableData>(
self,
body: &NewBody<B>,
secret_key: Option<&SecretKey>
) -> Result<Builder<SetPrivateOptions, T>, Error>[src]
self,
body: &NewBody<B>,
secret_key: Option<&SecretKey>
) -> Result<Builder<SetPrivateOptions, T>, Error>
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>(
self,
options: &OptionsList<C, E>,
secret_key: Option<&SecretKey>
) -> Result<Builder<SetPublicOptions, T>, Error>[src]
self,
options: &OptionsList<C, E>,
secret_key: Option<&SecretKey>
) -> Result<Builder<SetPublicOptions, T>, Error>
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>(
self,
options: &OptionsList<C, E>
) -> Result<Builder<SetPublicOptions, T>, Error>[src]
self,
options: &OptionsList<C, E>
) -> Result<Builder<SetPublicOptions, T>, Error>
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(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,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for Builder<S, T> where
S: Send,
T: Send,
S: Send,
T: Send,
impl<S, T> Sync for Builder<S, T> where
S: Sync,
T: Sync,
S: Sync,
T: Sync,
impl<S, T> Unpin for Builder<S, T> where
S: Unpin,
T: Unpin,
S: Unpin,
T: Unpin,
impl<S, T> UnwindSafe for Builder<S, T> where
S: UnwindSafe,
T: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,