Struct Properties

Source
pub struct Properties(/* private fields */);
Expand description

The prop XML element as defined in RFC 4918.

This element can contain arbitrary child elements and supports extracting them using Properties::get().

Implementations§

Source§

impl Properties

Source

pub fn new() -> Self

Source

pub fn with<E>(self, e: E) -> Self
where E: Element + Into<Value>,

Source

pub fn with_name<E>(self) -> Self
where E: Element,

Source§

impl Properties

Source

pub fn get<'v, P>(&'v self) -> Option<Option<Result<P, Error>>>
where P: Element + TryFrom<&'v Value, Error = Error>,

Read a specific property from this prop element.

Returns

  • None if the property doesn’t exist
  • Some(None) if the property exists and is empty
  • Some(Some(Ok(_))) if the property exists and was successfully extracted
  • Some(Some(Err(_))) if the property exists and extraction failed
Source

pub fn names(&self) -> impl Iterator<Item = &ElementName<ByteString>>

List the names of the properties in this prop element.

Source§

impl Properties

Source

pub fn creationdate(&self) -> Option<Option<Result<CreationDate, Error>>>

Read the creationdate property.

See Properties::get() for an overview of the possible return values.

Source

pub fn displayname(&self) -> Option<Option<Result<DisplayName, Error>>>

Read the displayname property.

See Properties::get() for an overview of the possible return values.

Source

pub fn getcontentlanguage( &self, ) -> Option<Option<Result<ContentLanguage, Error>>>

Read the getcontentlanguage property.

See Properties::get() for an overview of the possible return values.

Source

pub fn getcontentlength(&self) -> Option<Option<Result<ContentLength, Error>>>

Read the getcontentlength property.

See Properties::get() for an overview of the possible return values.

Source

pub fn getcontenttype(&self) -> Option<Option<Result<ContentType, Error>>>

Read the getcontenttype property.

See Properties::get() for an overview of the possible return values.

Source

pub fn getetag(&self) -> Option<Option<Result<ETag, Error>>>

Read the getetag property.

See Properties::get() for an overview of the possible return values.

Source

pub fn getlastmodified(&self) -> Option<Option<Result<LastModified, Error>>>

Read the getlastmodified property.

See Properties::get() for an overview of the possible return values.

Source

pub fn lockdiscovery(&self) -> Option<Option<Result<LockDiscovery, Error>>>

Read the lockdiscovery property.

See Properties::get() for an overview of the possible return values.

Source

pub fn resourcetype(&self) -> Option<Option<Result<ResourceType, Error>>>

Read the resourcetype property.

See Properties::get() for an overview of the possible return values.

Source

pub fn supportedlock(&self) -> Option<Option<Result<SupportedLock, Error>>>

Read the supportedlock property.

See Properties::get() for an overview of the possible return values.

Trait Implementations§

Source§

impl Clone for Properties

Source§

fn clone(&self) -> Properties

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Properties

Source§

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

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

impl Default for Properties

Source§

fn default() -> Properties

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

impl Element for Properties

Source§

const NAMESPACE: &'static str = DAV_NAMESPACE

XML namespace of the element, e.g. DAV:
Source§

const PREFIX: &'static str = DAV_PREFIX

The prefix used to abbreviate the namespace, e.g. d
Source§

const LOCAL_NAME: &'static str = "prop"

The local name of the element (the name inside the namespace), e.g. multistatus
Source§

impl From<Properties> for Value

Source§

fn from(Properties: Properties) -> Value

Converts to this type from the input type.
Source§

impl PartialEq for Properties

Source§

fn eq(&self, other: &Properties) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&Value> for Properties

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for Properties

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<E> FromXml for E
where E: Element + for<'v> TryFrom<&'v Value, Error = Error>,

Source§

fn from_xml(xml: impl Into<Bytes>) -> Result<E, Error>

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> IntoXml for T
where T: Element + Into<Value>,

Source§

fn write_xml(self, writer: impl Write) -> Result<(), Error>

Source§

fn into_xml(self) -> Result<Bytes>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.