pub struct Descriptor {
pub name: String,
pub class_id: String,
pub items: Vec<(String, DescriptorValue)>,
}Expand description
Дескриптор: classID + name + упорядоченный список полей.
items — Vec<(String, DescriptorValue)>: insertion-ordered, чтобы при записи
поля шли ровно в том порядке, в каком были добавлены (Photoshop это важно).
Fields§
§name: String§class_id: String§items: Vec<(String, DescriptorValue)>Implementations§
Source§impl Descriptor
impl Descriptor
pub fn new(name: impl Into<String>, class_id: impl Into<String>) -> Descriptor
Sourcepub fn set(
&mut self,
key: impl Into<String>,
value: DescriptorValue,
) -> &mut Self
pub fn set( &mut self, key: impl Into<String>, value: DescriptorValue, ) -> &mut Self
Добавляет поле в конец (сохраняя порядок вставки).
Sourcepub fn get(&self, key: &str) -> Option<&DescriptorValue>
pub fn get(&self, key: &str) -> Option<&DescriptorValue>
Первое значение по ключу (порядок не нарушается).
Trait Implementations§
Source§impl Clone for Descriptor
impl Clone for Descriptor
Source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Descriptor
impl Debug for Descriptor
Source§impl Default for Descriptor
impl Default for Descriptor
Source§fn default() -> Descriptor
fn default() -> Descriptor
Returns the “default value” for a type. Read more
Source§impl PartialEq for Descriptor
impl PartialEq for Descriptor
Source§fn eq(&self, other: &Descriptor) -> bool
fn eq(&self, other: &Descriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Descriptor
Auto Trait Implementations§
impl Freeze for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnsafeUnpin for Descriptor
impl UnwindSafe for Descriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more