Struct QListWidgetItem

Source
#[repr(C)]
pub struct QListWidgetItem { /* private fields */ }
Expand description

The QListWidgetItem class provides an item for use with the QListWidget item view class.

C++ class: QListWidgetItem.

C++ documentation:

The QListWidgetItem class provides an item for use with the QListWidget item view class.

A QListWidgetItem represents a single item in a QListWidget. Each item can hold several pieces of information, and will display them appropriately.

The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the QListView class with a standard model.

List items can be inserted automatically into a list, when they are constructed, by specifying the list widget:

new QListWidgetItem(tr(“Hazel”), listWidget);

Alternatively, list items can also be created without a parent widget, and later inserted into a list using QListWidget::insertItem().

List items are typically used to display text() and an icon(). These are set with the setText() and setIcon() functions. The appearance of the text can be customized with setFont(), setForeground(), and setBackground(). Text in list items can be aligned using the setTextAlignment() function. Tooltips, status tips and "What's This?" help can be added to list items with setToolTip(), setStatusTip(), and setWhatsThis().

By default, items are enabled, selectable, checkable, and can be the source of drag and drop operations.

Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked, unchecked and partially checked with the setCheckState() function. The corresponding checkState() function indicates the item's current check state.

The isHidden() function can be used to determine whether the item is hidden. To hide an item, use setHidden().

Implementations§

Source§

impl QListWidgetItem

Source

pub unsafe fn background(&self) -> CppBox<QBrush>

Returns the brush used to display the list item's background.

Calls C++ function: QBrush QListWidgetItem::background() const.

C++ documentation:

Returns the brush used to display the list item’s background.

This function was introduced in Qt 4.2.

See also setBackground() and foreground().

Source

pub unsafe fn background_color(&self) -> CppBox<QColor>

This function is deprecated. Use background() instead.

Calls C++ function: QColor QListWidgetItem::backgroundColor() const.

C++ documentation:

This function is deprecated. Use background() instead.

See also setBackgroundColor().

Source

pub unsafe fn check_state(&self) -> CheckState

Returns the checked state of the list item (see Qt::CheckState).

Calls C++ function: Qt::CheckState QListWidgetItem::checkState() const.

C++ documentation:

Returns the checked state of the list item (see Qt::CheckState).

See also setCheckState() and flags().

Source

pub unsafe fn clone(&self) -> Ptr<QListWidgetItem>

Creates an exact copy of the item.

Calls C++ function: virtual QListWidgetItem* QListWidgetItem::clone() const.

C++ documentation:

Creates an exact copy of the item.

Source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QListWidgetItem>>, ) -> Ref<QListWidgetItem>

Assigns other's data and flags to this item. Note that type() and listWidget() are not copied.

Calls C++ function: QListWidgetItem& QListWidgetItem::operator=(const QListWidgetItem& other).

C++ documentation:

Assigns other’s data and flags to this item. Note that type() and listWidget() are not copied.

This function is useful when reimplementing clone().

See also data() and flags().

Source

pub unsafe fn data(&self, role: c_int) -> CppBox<QVariant>

Returns the item's data for a given role. Reimplement this function if you need extra roles or special behavior for certain roles.

Calls C++ function: virtual QVariant QListWidgetItem::data(int role) const.

C++ documentation:

Returns the item’s data for a given role. Reimplement this function if you need extra roles or special behavior for certain roles.

See also Qt::ItemDataRole and setData().

Source

pub unsafe fn flags(&self) -> QFlags<ItemFlag>

Returns the item flags for this item (see Qt::ItemFlags).

Calls C++ function: QFlags<Qt::ItemFlag> QListWidgetItem::flags() const.

C++ documentation:

Returns the item flags for this item (see Qt::ItemFlags).

See also setFlags().

Source

pub unsafe fn font(&self) -> CppBox<QFont>

Returns the font used to display this list item's text.

Calls C++ function: QFont QListWidgetItem::font() const.

C++ documentation:

Returns the font used to display this list item’s text.

See also setFont().

Source

pub unsafe fn foreground(&self) -> CppBox<QBrush>

Returns the brush used to display the list item's foreground (e.g. text).

Calls C++ function: QBrush QListWidgetItem::foreground() const.

C++ documentation:

Returns the brush used to display the list item’s foreground (e.g. text).

This function was introduced in Qt 4.2.

See also setForeground() and background().

Source

pub unsafe fn icon(&self) -> CppBox<QIcon>

Returns the list item's icon.

Calls C++ function: QIcon QListWidgetItem::icon() const.

C++ documentation:

Returns the list item’s icon.

See also setIcon() and iconSize.

Source

pub unsafe fn is_hidden(&self) -> bool

Returns true if the item is hidden; otherwise returns false.

Calls C++ function: bool QListWidgetItem::isHidden() const.

C++ documentation:

Returns true if the item is hidden; otherwise returns false.

This function was introduced in Qt 4.2.

See also setHidden().

Source

pub unsafe fn is_selected(&self) -> bool

Returns true if the item is selected; otherwise returns false.

Calls C++ function: bool QListWidgetItem::isSelected() const.

C++ documentation:

Returns true if the item is selected; otherwise returns false.

This function was introduced in Qt 4.2.

See also setSelected().

Source

pub unsafe fn list_widget(&self) -> QPtr<QListWidget>

Returns the list widget containing the item.

Calls C++ function: QListWidget* QListWidgetItem::listWidget() const.

C++ documentation:

Returns the list widget containing the item.

Source

pub unsafe fn from_q_list_widget_int( view: impl CastInto<Ptr<QListWidget>>, type_: c_int, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given parent. If parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(QListWidget* view = …, int type = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given parent. If parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_string_q_list_widget_int( text: impl CastInto<Ref<QString>>, view: impl CastInto<Ptr<QListWidget>>, type_: c_int, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QString& text, QListWidget* view = …, int type = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_icon_q_string_q_list_widget_int( icon: impl CastInto<Ref<QIcon>>, text: impl CastInto<Ref<QString>>, view: impl CastInto<Ptr<QListWidget>>, type_: c_int, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QIcon& icon, const QString& text, QListWidget* view = …, int type = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn new() -> CppBox<QListWidgetItem>

The QListWidgetItem class provides an item for use with the QListWidget item view class.

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem().

C++ documentation:

The QListWidgetItem class provides an item for use with the QListWidget item view class.

A QListWidgetItem represents a single item in a QListWidget. Each item can hold several pieces of information, and will display them appropriately.

The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the QListView class with a standard model.

List items can be inserted automatically into a list, when they are constructed, by specifying the list widget:

new QListWidgetItem(tr(“Hazel”), listWidget);

Alternatively, list items can also be created without a parent widget, and later inserted into a list using QListWidget::insertItem().

List items are typically used to display text() and an icon(). These are set with the setText() and setIcon() functions. The appearance of the text can be customized with setFont(), setForeground(), and setBackground(). Text in list items can be aligned using the setTextAlignment() function. Tooltips, status tips and "What's This?" help can be added to list items with setToolTip(), setStatusTip(), and setWhatsThis().

By default, items are enabled, selectable, checkable, and can be the source of drag and drop operations.

Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked, unchecked and partially checked with the setCheckState() function. The corresponding checkState() function indicates the item's current check state.

The isHidden() function can be used to determine whether the item is hidden. To hide an item, use setHidden().

Source

pub unsafe fn from_q_list_widget( view: impl CastInto<Ptr<QListWidget>>, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given parent. If parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(QListWidget* view = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given parent. If parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_string_q_list_widget( text: impl CastInto<Ref<QString>>, view: impl CastInto<Ptr<QListWidget>>, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QString& text, QListWidget* view = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_string( text: impl CastInto<Ref<QString>>, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QString& text).

C++ documentation:

Constructs an empty list widget item of the specified type with the given text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_icon_q_string_q_list_widget( icon: impl CastInto<Ref<QIcon>>, text: impl CastInto<Ref<QString>>, view: impl CastInto<Ptr<QListWidget>>, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QIcon& icon, const QString& text, QListWidget* view = …).

C++ documentation:

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn from_q_icon_q_string( icon: impl CastInto<Ref<QIcon>>, text: impl CastInto<Ref<QString>>, ) -> CppBox<QListWidgetItem>

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QIcon& icon, const QString& text).

C++ documentation:

Constructs an empty list widget item of the specified type with the given icon, text and parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem().

This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the '<' operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use QListWidget::insertItem() instead.

See also type().

Source

pub unsafe fn new_copy( other: impl CastInto<Ref<QListWidgetItem>>, ) -> CppBox<QListWidgetItem>

Constructs a copy of other. Note that type() and listWidget() are not copied.

Calls C++ function: [constructor] void QListWidgetItem::QListWidgetItem(const QListWidgetItem& other).

C++ documentation:

Constructs a copy of other. Note that type() and listWidget() are not copied.

This function is useful when reimplementing clone().

This function was introduced in Qt 4.1.

See also data() and flags().

Source

pub unsafe fn read(&self, in_: impl CastInto<Ref<QDataStream>>)

Reads the item from stream in.

Calls C++ function: virtual void QListWidgetItem::read(QDataStream& in).

C++ documentation:

Reads the item from stream in.

See also write().

Source

pub unsafe fn set_background(&self, brush: impl CastInto<Ref<QBrush>>)

Sets the background brush of the list item to the given brush.

Calls C++ function: void QListWidgetItem::setBackground(const QBrush& brush).

C++ documentation:

Sets the background brush of the list item to the given brush.

This function was introduced in Qt 4.2.

See also background() and setForeground().

Source

pub unsafe fn set_background_color(&self, color: impl CastInto<Ref<QColor>>)

This function is deprecated. Use setBackground() instead.

Calls C++ function: virtual void QListWidgetItem::setBackgroundColor(const QColor& color).

C++ documentation:

This function is deprecated. Use setBackground() instead.

See also backgroundColor().

Source

pub unsafe fn set_check_state(&self, state: CheckState)

Sets the check state of the list item to state.

Calls C++ function: void QListWidgetItem::setCheckState(Qt::CheckState state).

C++ documentation:

Sets the check state of the list item to state.

See also checkState().

Source

pub unsafe fn set_data(&self, role: c_int, value: impl CastInto<Ref<QVariant>>)

Sets the data for a given role to the given value. Reimplement this function if you need extra roles or special behavior for certain roles.

Calls C++ function: virtual void QListWidgetItem::setData(int role, const QVariant& value).

C++ documentation:

Sets the data for a given role to the given value. Reimplement this function if you need extra roles or special behavior for certain roles.

Note: The default implementation treats Qt::EditRole and Qt::DisplayRole as referring to the same data.

See also Qt::ItemDataRole and data().

Source

pub unsafe fn set_flags(&self, flags: QFlags<ItemFlag>)

Sets the item flags for the list item to flags.

Calls C++ function: void QListWidgetItem::setFlags(QFlags<Qt::ItemFlag> flags).

C++ documentation:

Sets the item flags for the list item to flags.

See also flags() and Qt::ItemFlags.

Source

pub unsafe fn set_font(&self, font: impl CastInto<Ref<QFont>>)

Sets the font used when painting the item to the given font.

Calls C++ function: void QListWidgetItem::setFont(const QFont& font).

C++ documentation:

Sets the font used when painting the item to the given font.

See also font().

Source

pub unsafe fn set_foreground(&self, brush: impl CastInto<Ref<QBrush>>)

Sets the foreground brush of the list item to the given brush.

Calls C++ function: void QListWidgetItem::setForeground(const QBrush& brush).

C++ documentation:

Sets the foreground brush of the list item to the given brush.

This function was introduced in Qt 4.2.

See also foreground() and setBackground().

Source

pub unsafe fn set_hidden(&self, hide: bool)

Hides the item if hide is true; otherwise shows the item.

Calls C++ function: void QListWidgetItem::setHidden(bool hide).

C++ documentation:

Hides the item if hide is true; otherwise shows the item.

This function was introduced in Qt 4.2.

See also isHidden().

Source

pub unsafe fn set_icon(&self, icon: impl CastInto<Ref<QIcon>>)

Sets the icon for the list item to the given icon.

Calls C++ function: void QListWidgetItem::setIcon(const QIcon& icon).

C++ documentation:

Sets the icon for the list item to the given icon.

See also icon(), text(), and iconSize.

Source

pub unsafe fn set_selected(&self, select: bool)

Sets the selected state of the item to select.

Calls C++ function: void QListWidgetItem::setSelected(bool select).

C++ documentation:

Sets the selected state of the item to select.

This function was introduced in Qt 4.2.

See also isSelected().

Source

pub unsafe fn set_size_hint(&self, size: impl CastInto<Ref<QSize>>)

Sets the size hint for the list item to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

Calls C++ function: void QListWidgetItem::setSizeHint(const QSize& size).

C++ documentation:

Sets the size hint for the list item to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

This function was introduced in Qt 4.1.

See also sizeHint().

Source

pub unsafe fn set_status_tip(&self, status_tip: impl CastInto<Ref<QString>>)

Sets the status tip for the list item to the text specified by statusTip. QListWidget mouseTracking needs to be enabled for this feature to work.

Calls C++ function: void QListWidgetItem::setStatusTip(const QString& statusTip).

C++ documentation:

Sets the status tip for the list item to the text specified by statusTip. QListWidget mouseTracking needs to be enabled for this feature to work.

See also statusTip(), setToolTip(), setWhatsThis(), and QWidget::setMouseTracking().

Source

pub unsafe fn set_text(&self, text: impl CastInto<Ref<QString>>)

Sets the text for the list widget item's to the given text.

Calls C++ function: void QListWidgetItem::setText(const QString& text).

C++ documentation:

Sets the text for the list widget item’s to the given text.

See also text().

Source

pub unsafe fn set_text_alignment(&self, alignment: c_int)

Sets the list item's text alignment to alignment.

Calls C++ function: void QListWidgetItem::setTextAlignment(int alignment).

C++ documentation:

Sets the list item’s text alignment to alignment.

See also textAlignment() and Qt::AlignmentFlag.

Source

pub unsafe fn set_text_color(&self, color: impl CastInto<Ref<QColor>>)

This function is deprecated. Use setForeground() instead.

Calls C++ function: void QListWidgetItem::setTextColor(const QColor& color).

C++ documentation:

This function is deprecated. Use setForeground() instead.

See also textColor().

Source

pub unsafe fn set_tool_tip(&self, tool_tip: impl CastInto<Ref<QString>>)

Sets the tooltip for the list item to the text specified by toolTip.

Calls C++ function: void QListWidgetItem::setToolTip(const QString& toolTip).

C++ documentation:

Sets the tooltip for the list item to the text specified by toolTip.

See also toolTip(), setStatusTip(), and setWhatsThis().

Source

pub unsafe fn set_whats_this(&self, whats_this: impl CastInto<Ref<QString>>)

Sets the "What's This?" help for the list item to the text specified by whatsThis.

Calls C++ function: void QListWidgetItem::setWhatsThis(const QString& whatsThis).

C++ documentation:

Sets the “What’s This?” help for the list item to the text specified by whatsThis.

See also whatsThis(), setStatusTip(), and setToolTip().

Source

pub unsafe fn size_hint(&self) -> CppBox<QSize>

Returns the size hint set for the list item.

Calls C++ function: QSize QListWidgetItem::sizeHint() const.

C++ documentation:

Returns the size hint set for the list item.

This function was introduced in Qt 4.1.

See also setSizeHint().

Source

pub unsafe fn status_tip(&self) -> CppBox<QString>

Returns the list item's status tip.

Calls C++ function: QString QListWidgetItem::statusTip() const.

C++ documentation:

Returns the list item’s status tip.

See also setStatusTip().

Source

pub unsafe fn text(&self) -> CppBox<QString>

Returns the list item's text.

Calls C++ function: QString QListWidgetItem::text() const.

C++ documentation:

Returns the list item’s text.

See also setText().

Source

pub unsafe fn text_alignment(&self) -> c_int

Returns the text alignment for the list item.

Calls C++ function: int QListWidgetItem::textAlignment() const.

C++ documentation:

Returns the text alignment for the list item.

See also setTextAlignment() and Qt::AlignmentFlag.

Source

pub unsafe fn text_color(&self) -> CppBox<QColor>

Returns the color used to display the list item's text.

Calls C++ function: QColor QListWidgetItem::textColor() const.

C++ documentation:

Returns the color used to display the list item’s text.

This function is deprecated. Use foreground() instead.

See also setTextColor().

Source

pub unsafe fn tool_tip(&self) -> CppBox<QString>

Returns the list item's tooltip.

Calls C++ function: QString QListWidgetItem::toolTip() const.

C++ documentation:

Returns the list item’s tooltip.

See also setToolTip(), statusTip(), and whatsThis().

Source

pub unsafe fn type_(&self) -> c_int

Returns the type passed to the QListWidgetItem constructor.

Calls C++ function: int QListWidgetItem::type() const.

C++ documentation:

Returns the type passed to the QListWidgetItem constructor.

Source

pub unsafe fn whats_this(&self) -> CppBox<QString>

Returns the list item's "What's This?" help text.

Calls C++ function: QString QListWidgetItem::whatsThis() const.

C++ documentation:

Returns the list item’s “What’s This?” help text.

See also setWhatsThis(), statusTip(), and toolTip().

Source

pub unsafe fn write(&self, out: impl CastInto<Ref<QDataStream>>)

Writes the item to stream out.

Calls C++ function: virtual void QListWidgetItem::write(QDataStream& out) const.

C++ documentation:

Writes the item to stream out.

See also read().

Trait Implementations§

Source§

impl CppDeletable for QListWidgetItem

Source§

unsafe fn delete(&self)

Destroys the list item.

Calls C++ function: virtual [destructor] void QListWidgetItem::~QListWidgetItem().

C++ documentation:

Destroys the list item.

Source§

impl Lt<Ref<QListWidgetItem>> for QListWidgetItem

Source§

unsafe fn lt(&self, other: &Ref<QListWidgetItem>) -> bool

Returns true if this item's text is less then other item's text; otherwise returns false.

Calls C++ function: virtual bool QListWidgetItem::operator<(const QListWidgetItem& other) const.

C++ documentation:

Returns true if this item’s text is less then other item’s text; otherwise returns false.

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, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

unsafe fn cast_into(self) -> U

Performs the conversion. 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> StaticUpcast<T> for T

Source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. 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.