Skip to main content

MultiValueMut

Struct MultiValueMut 

Source
pub struct MultiValueMut<'borrow> { /* private fields */ }
Expand description

An intermediate representation of a mutable multivar obtained from a File.

Implementations§

Source§

impl MultiValueMut<'_>

Source

pub fn get(&self) -> Result<Vec<BString>, Error>

Returns the actual values.

Source

pub fn len(&self) -> usize

Returns the amount of values within this multivar.

Source

pub fn is_empty(&self) -> bool

Returns true if the multivar does not have any values. This might occur if the value was deleted but wasn’t yet set with a new value.

Source

pub fn set_string_at( &mut self, index: usize, value: impl AsRef<str>, ) -> Result<(), Error>

Sets the value at the given index.

§Safety

This will panic if the index is out of range.

Source

pub fn set_at(&mut self, index: usize, value: impl AsBStr) -> Result<(), Error>

Sets the value at the given index.

§Safety

This will panic if the index is out of range.

Source

pub fn set_values<Iter, Item>(&mut self, values: Iter) -> Result<(), Error>
where Iter: IntoIterator<Item = Item>, Item: AsBStr,

Sets all values to the provided ones. Note that this follows zip logic: if the number of values in the input is less than the number of values currently existing, then only the first n values are modified. If more values are provided than there currently are, then the remaining values are ignored.

Source

pub fn set_all(&mut self, input: impl AsBStr) -> Result<(), Error>

Sets all values in this multivar to the provided one without owning the provided input.

Source

pub fn delete(&mut self, index: usize)

Removes the value at the given index. Does nothing when called multiple times in succession.

§Safety

This will panic if the index is out of range.

Source

pub fn delete_all(&mut self)

Removes all values. Does nothing when called multiple times in succession.

Trait Implementations§

Source§

impl<'borrow> Debug for MultiValueMut<'borrow>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'borrow> !Send for MultiValueMut<'borrow>

§

impl<'borrow> !Sync for MultiValueMut<'borrow>

§

impl<'borrow> !UnwindSafe for MultiValueMut<'borrow>

§

impl<'borrow> Freeze for MultiValueMut<'borrow>

§

impl<'borrow> RefUnwindSafe for MultiValueMut<'borrow>

§

impl<'borrow> Unpin for MultiValueMut<'borrow>

§

impl<'borrow> UnsafeUnpin for MultiValueMut<'borrow>

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> Same for T

Source§

type Output = T

Should always be Self
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.