pub struct DataFormatOf<T> { /* private fields */ }Expand description
Represents a format usable with the clipboard and drag-and-drop, with a data type.
T is the type of the values of the format as they are handed out:
String for text, Rc<[u8]> for bytes, Rc<Bitmap> for bitmaps. It
is only used to resolve the typed accessors.
This type cannot be instantiated directly. Use universal formats such as
DataFormat::text, or create custom formats using
DataFormat::create_bytes_application_format,
DataFormat::create_string_application_format,
DataFormat::create_bytes_platform_format,
DataFormat::create_string_platform_format or
DataFormat::create_in_process_format.
Implementations§
Source§impl<T> DataFormatOf<T>
impl<T> DataFormatOf<T>
Sourcepub fn as_data_format(&self) -> &DataFormat
pub fn as_data_format(&self) -> &DataFormat
The format without its data type.
Methods from Deref<Target = DataFormat>§
Sourcepub fn data_type(&self) -> Option<TypeId>
pub fn data_type(&self) -> Option<TypeId>
The type of the values of the format (String for a format of
strings, Rc<[u8]> for a format of bytes), when the format was
created with one: the counterpart of asking whether a format of the
managed original is a DataFormat<string> or a DataFormat<byte[]>,
which a platform backend does to decide how to read data the system
does not describe. Two formats that differ in it alone are equal.
Sourcepub fn kind(&self) -> DataFormatKind
pub fn kind(&self) -> DataFormatKind
The kind of the data format.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
The identifier of the data format.
Sourcepub fn to_system_name(&self, application_prefix: &str) -> String
pub fn to_system_name(&self, application_prefix: &str) -> String
Creates a name for this format, usable by the underlying platform.
application_prefix is the system prefix used to recognize the name
as an application format.
§Panics
This method can only be called if kind is
DataFormatKind::Application or DataFormatKind::Platform.
Trait Implementations§
Source§impl<T> Clone for DataFormatOf<T>
impl<T> Clone for DataFormatOf<T>
Source§impl<T> Debug for DataFormatOf<T>
impl<T> Debug for DataFormatOf<T>
Source§impl<T> Deref for DataFormatOf<T>
impl<T> Deref for DataFormatOf<T>
Source§type Target = DataFormat
type Target = DataFormat
Source§fn deref(&self) -> &DataFormat
fn deref(&self) -> &DataFormat
Source§impl<T> Display for DataFormatOf<T>
impl<T> Display for DataFormatOf<T>
impl<T> Eq for DataFormatOf<T>
Source§impl<T> From<DataFormatOf<T>> for DataFormat
impl<T> From<DataFormatOf<T>> for DataFormat
Source§fn from(value: DataFormatOf<T>) -> DataFormat
fn from(value: DataFormatOf<T>) -> DataFormat
Source§impl<T> Hash for DataFormatOf<T>
impl<T> Hash for DataFormatOf<T>
Source§impl<T> PartialEq<DataFormat> for DataFormatOf<T>
impl<T> PartialEq<DataFormat> for DataFormatOf<T>
Source§impl<T> PartialEq<DataFormatOf<T>> for DataFormat
impl<T> PartialEq<DataFormatOf<T>> for DataFormat
Auto Trait Implementations§
impl<T> !Send for DataFormatOf<T>
impl<T> !Sync for DataFormatOf<T>
impl<T> Freeze for DataFormatOf<T>
impl<T> RefUnwindSafe for DataFormatOf<T>
impl<T> Unpin for DataFormatOf<T>
impl<T> UnsafeUnpin for DataFormatOf<T>
impl<T> UnwindSafe for DataFormatOf<T>
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more