Skip to main content

OperationBuilder

Struct OperationBuilder 

Source
pub struct OperationBuilder<Op: UPnPOperation> { /* private fields */ }
Expand description

Builder for constructing UPnP operations with configuration

The OperationBuilder allows for fluent construction of operations with validation levels, timeouts, and other configuration.

§Type Parameters

  • Op - The UPnP operation type being built

Implementations§

Source§

impl<Op: UPnPOperation> OperationBuilder<Op>

Source

pub fn new(request: Op::Request) -> Self

Create a new operation builder with the given request

§Arguments
  • request - The typed request data for the operation
§Returns

A new operation builder with default configuration

Source

pub fn with_validation(self, level: ValidationLevel) -> Self

Set the validation level for the operation

§Arguments
  • level - The validation level to use
§Returns

The builder for method chaining

Source

pub fn with_timeout(self, timeout: Duration) -> Self

Set a timeout for the operation

§Arguments
  • timeout - The timeout duration
§Returns

The builder for method chaining

Source

pub fn build(self) -> Result<ComposableOperation<Op>, ValidationError>

Build the final composable operation

This validates the request according to the configured validation level and creates a ComposableOperation ready for execution.

§Returns

A ComposableOperation or a validation error

Source

pub fn build_unchecked(self) -> ComposableOperation<Op>

Build without validation (for performance-critical scenarios)

This bypasses validation and creates the operation directly. Use with caution - invalid requests may cause runtime errors.

§Returns

A ComposableOperation without validation

Source

pub fn validation_level(&self) -> ValidationLevel

Get the current validation level

Source

pub fn timeout(&self) -> Option<Duration>

Get the current timeout setting

Auto Trait Implementations§

§

impl<Op> Freeze for OperationBuilder<Op>
where <Op as UPnPOperation>::Request: Freeze,

§

impl<Op> RefUnwindSafe for OperationBuilder<Op>

§

impl<Op> Send for OperationBuilder<Op>
where <Op as UPnPOperation>::Request: Send, Op: Send,

§

impl<Op> Sync for OperationBuilder<Op>
where <Op as UPnPOperation>::Request: Sync, Op: Sync,

§

impl<Op> Unpin for OperationBuilder<Op>
where <Op as UPnPOperation>::Request: Unpin, Op: Unpin,

§

impl<Op> UnsafeUnpin for OperationBuilder<Op>

§

impl<Op> UnwindSafe for OperationBuilder<Op>

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 = 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>,

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.