Trait bevy_internal::utils::smallvec::alloc::fmt::Octal

1.0.0 · source ·
pub trait Octal {
    // Required method
    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>;
}
Expand description

o formatting.

The Octal trait should format its output as a number in base-8.

For primitive signed integers (i8 to i128, and isize), negative values are formatted as the two’s complement representation.

The alternate flag, #, adds a 0o in front of the output.

For more information on formatters, see the module-level documentation.

Examples

Basic usage with i32:

let x = 42; // 42 is '52' in octal

assert_eq!(format!("{x:o}"), "52");
assert_eq!(format!("{x:#o}"), "0o52");

assert_eq!(format!("{:o}", -16), "37777777760");

Implementing Octal on a type:

use std::fmt;

struct Length(i32);

impl fmt::Octal for Length {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let val = self.0;

        fmt::Octal::fmt(&val, f) // delegate to i32's implementation
    }
}

let l = Length(9);

assert_eq!(format!("l as octal is: {l:o}"), "l as octal is: 11");

assert_eq!(format!("l as octal is: {l:#06o}"), "l as octal is: 0o0011");

Required Methods§

source

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

Formats the value using the given formatter.

Implementors§

source§

impl Octal for i8

source§

impl Octal for i16

source§

impl Octal for i32

source§

impl Octal for i64

source§

impl Octal for i128

source§

impl Octal for isize

source§

impl Octal for u8

source§

impl Octal for u16

source§

impl Octal for u32

source§

impl Octal for u64

source§

impl Octal for u128

source§

impl Octal for usize

source§

impl Octal for alsa::poll::Flags

source§

impl Octal for PortCap

source§

impl Octal for PortType

source§

impl Octal for Remove

source§

impl Octal for UsageFlags

source§

impl Octal for AllocationFlags

source§

impl Octal for MemoryPropertyFlags

source§

impl Octal for DescriptorSetLayoutCreateFlags

source§

impl Octal for DescriptorPoolCreateFlags

source§

impl Octal for EventMask

source§

impl Octal for WatchMask

source§

impl Octal for ChannelTypeQualifiers

source§

impl Octal for DataFormatFlags

source§

impl Octal for naga::back::glsl::features::Features

source§

impl Octal for naga::back::glsl::WriterFlags

source§

impl Octal for ImageTypeFlags

source§

impl Octal for naga::back::spv::WriterFlags

source§

impl Octal for RayFlag

source§

impl Octal for naga::back::wgsl::writer::WriterFlags

source§

impl Octal for Barrier

source§

impl Octal for StorageAccess

source§

impl Octal for GlobalUse

source§

impl Octal for UniformityRequirements

source§

impl Octal for Capabilities

source§

impl Octal for naga::valid::ShaderStages

source§

impl Octal for ValidationFlags

source§

impl Octal for TypeFlags

source§

impl Octal for nix::fcntl::AtFlags

source§

impl Octal for nix::fcntl::FallocateFlags

source§

impl Octal for FdFlag

source§

impl Octal for OFlag

source§

impl Octal for nix::fcntl::RenameFlags

source§

impl Octal for SealFlag

source§

impl Octal for MntFlags

source§

impl Octal for MsFlags

source§

impl Octal for CloneFlags

source§

impl Octal for EpollCreateFlags

source§

impl Octal for EpollFlags

source§

impl Octal for EfdFlags

source§

impl Octal for MemFdCreateFlag

source§

impl Octal for SaFlags

source§

impl Octal for SfdFlags

source§

impl Octal for nix::sys::stat::Mode

source§

impl Octal for SFlag

source§

impl Octal for FsFlags

source§

impl Octal for WaitPidFlag

source§

impl Octal for AccessFlags

source§

impl Octal for Transformations

source§

impl Octal for rustix::backend::event::epoll::CreateFlags

source§

impl Octal for EventFlags

source§

impl Octal for PollFlags

source§

impl Octal for EventfdFlags

source§

impl Octal for rustix::backend::fs::inotify::CreateFlags

source§

impl Octal for WatchFlags

source§

impl Octal for Access

source§

impl Octal for rustix::backend::fs::types::AtFlags

source§

impl Octal for rustix::backend::fs::types::FallocateFlags

source§

impl Octal for MemfdFlags

source§

impl Octal for rustix::backend::fs::types::Mode

source§

impl Octal for OFlags

source§

impl Octal for rustix::backend::fs::types::RenameFlags

source§

impl Octal for ResolveFlags

source§

impl Octal for SealFlags

source§

impl Octal for StatVfsMountFlags

source§

impl Octal for StatxFlags

source§

impl Octal for DupFlags

source§

impl Octal for FdFlags

source§

impl Octal for ReadWriteFlags

source§

impl Octal for MountFlags

source§

impl Octal for MountPropagationFlags

source§

impl Octal for UnmountFlags

source§

impl Octal for RecvFlags

source§

impl Octal for SendFlags

source§

impl Octal for PipeFlags

source§

impl Octal for SpliceFlags

source§

impl Octal for ShmOFlags

source§

impl Octal for FutexFlags

source§

impl Octal for TimerfdFlags

source§

impl Octal for TimerfdTimerFlags

source§

impl Octal for IFlags

source§

impl Octal for XattrFlags

source§

impl Octal for SocketFlags

source§

impl Octal for SockaddrXdpFlags

source§

impl Octal for XdpDescOptions

source§

impl Octal for XdpOptionsFlags

source§

impl Octal for XdpRingFlags

source§

impl Octal for XdpUmemRegFlags

source§

impl Octal for MembarrierQuery

source§

impl Octal for PidfdFlags

source§

impl Octal for PidfdGetfdFlags

source§

impl Octal for FloatingPointEmulationControl

source§

impl Octal for FloatingPointExceptionMode

source§

impl Octal for SpeculationFeatureControl

source§

impl Octal for SpeculationFeatureState

source§

impl Octal for UnalignedAccessControl

source§

impl Octal for WaitOptions

source§

impl Octal for WaitidOptions

source§

impl Octal for CapabilityFlags

source§

impl Octal for CapabilitiesSecureBits

source§

impl Octal for TaggedAddressMode

source§

impl Octal for ThreadNameSpaceType

source§

impl Octal for UnshareFlags

source§

impl Octal for smithay_client_toolkit::shell::wlr_layer::Anchor

source§

impl Octal for CooperativeMatrixOperands

source§

impl Octal for FPFastMathMode

source§

impl Octal for FragmentShadingRate

source§

impl Octal for FunctionControl

source§

impl Octal for ImageOperands

source§

impl Octal for KernelProfilingInfo

source§

impl Octal for LoopControl

source§

impl Octal for MemoryAccess

source§

impl Octal for MemorySemantics

source§

impl Octal for RayFlags

source§

impl Octal for SelectionControl

source§

impl Octal for DndAction

source§

impl Octal for wayland_client::protocol::wl_output::Mode

source§

impl Octal for wayland_client::protocol::wl_seat::Capability

source§

impl Octal for Resize

source§

impl Octal for Transient

source§

impl Octal for WindowManagerCapabilities

source§

impl Octal for WindowState

source§

impl Octal for wayland_protocols::wp::linux_dmabuf::zv1::generated::client::zwp_linux_buffer_params_v1::Flags

source§

impl Octal for TrancheFlags

source§

impl Octal for Kind

source§

impl Octal for wayland_protocols::wp::text_input::zv1::generated::client::zwp_text_input_v1::ContentHint

source§

impl Octal for wayland_protocols::wp::text_input::zv3::generated::client::zwp_text_input_v3::ContentHint

source§

impl Octal for ConstraintAdjustment

source§

impl Octal for wayland_protocols_plasma::output_device::v1::generated::client::org_kde_kwin_outputdevice::Capability

source§

impl Octal for wayland_protocols_plasma::output_device::v2::generated::client::kde_output_device_v2::Capability

source§

impl Octal for wayland_protocols_plasma::text_input::v2::generated::client::zwp_text_input_v2::ContentHint

source§

impl Octal for wayland_protocols_wlr::layer_shell::v1::generated::client::zwlr_layer_surface_v1::Anchor

source§

impl Octal for wayland_protocols_wlr::screencopy::v1::generated::client::zwlr_screencopy_frame_v1::Flags

source§

impl Octal for PipelineFlags

source§

impl Octal for AccelerationStructureUses

source§

impl Octal for AttachmentOps

source§

impl Octal for BindGroupLayoutFlags

source§

impl Octal for BufferUses

source§

impl Octal for FormatAspects

source§

impl Octal for MemoryFlags

source§

impl Octal for PipelineLayoutFlags

source§

impl Octal for TextureFormatCapabilities

source§

impl Octal for TextureUses

source§

impl Octal for Workarounds

source§

impl Octal for AccelerationStructureFlags

source§

impl Octal for AccelerationStructureGeometryFlags

source§

impl Octal for DownlevelFlags

source§

impl Octal for PipelineStatisticsTypes

source§

impl Octal for TextureFormatFeatureFlags

source§

impl Octal for ModifiersState

source§

impl Octal for WindowButtons

source§

impl Octal for xkb_state_component

source§

impl Octal for bevy_internal::pbr::MeshFlags

source§

impl Octal for MeshPipelineKey

source§

impl Octal for MeshPipelineViewLayoutKey

source§

impl Octal for StandardMaterialFlags

source§

impl Octal for RenderAssetUsages

source§

impl Octal for BufferUsages

source§

impl Octal for ColorWrites

source§

impl Octal for bevy_internal::render::render_resource::ShaderStages

source§

impl Octal for TextureUsages

source§

impl Octal for Backends

source§

impl Octal for InstanceFlags

source§

impl Octal for bevy_internal::render::settings::WgpuFeatures

source§

impl Octal for CompressedImageFormats

source§

impl Octal for Extensions

source§

impl Octal for ColorMaterialFlags

source§

impl Octal for Mesh2dPipelineKey

source§

impl Octal for bevy_internal::sprite::MeshFlags

source§

impl Octal for SpritePipelineKey

source§

impl Octal for NonMaxI8

source§

impl Octal for NonMaxI16

source§

impl Octal for NonMaxI32

source§

impl Octal for NonMaxI64

source§

impl Octal for NonMaxI128

source§

impl Octal for NonMaxIsize

source§

impl Octal for NonMaxU8

source§

impl Octal for NonMaxU16

source§

impl Octal for NonMaxU32

source§

impl Octal for NonMaxU64

source§

impl Octal for NonMaxU128

source§

impl Octal for NonMaxUsize

1.34.0 · source§

impl Octal for NonZeroI8

1.34.0 · source§

impl Octal for NonZeroI16

1.34.0 · source§

impl Octal for NonZeroI32

1.34.0 · source§

impl Octal for NonZeroI64

1.34.0 · source§

impl Octal for NonZeroI128

1.34.0 · source§

impl Octal for NonZeroIsize

1.28.0 · source§

impl Octal for NonZeroU8

1.28.0 · source§

impl Octal for NonZeroU16

1.28.0 · source§

impl Octal for NonZeroU32

1.28.0 · source§

impl Octal for NonZeroU64

1.28.0 · source§

impl Octal for NonZeroU128

1.28.0 · source§

impl Octal for NonZeroUsize

source§

impl<'s, T> Octal for SliceVec<'s, T>
where T: Octal,

source§

impl<A> Octal for TinyVec<A>
where A: Array, <A as Array>::Item: Octal,

source§

impl<A> Octal for ArrayVec<A>
where A: Array, <A as Array>::Item: Octal,

source§

impl<T> Octal for &T
where T: Octal + ?Sized,

source§

impl<T> Octal for &mut T
where T: Octal + ?Sized,

1.74.0 · source§

impl<T> Octal for Saturating<T>
where T: Octal,

1.11.0 · source§

impl<T> Octal for Wrapping<T>
where T: Octal,