Struct VmfBlock

Source
pub struct VmfBlock {
    pub name: String,
    pub key_values: IndexMap<String, String>,
    pub blocks: Vec<VmfBlock>,
}
Expand description

Represents a block in a VMF file, which can contain key-value pairs and other blocks.

Fields§

§name: String

The name of the block.

§key_values: IndexMap<String, String>

The key-value pairs in the block.

§blocks: Vec<VmfBlock>

The child blocks contained within this block.

Implementations§

Source§

impl VmfBlock

Source

pub fn serialize(&self, indent_level: usize) -> String

Serializes the VmfBlock into a string with the specified indentation level.

§Arguments
  • indent_level - The indentation level to use for formatting.
§Returns

A string representation of the VmfBlock in VMF format.

Trait Implementations§

Source§

impl Debug for VmfBlock

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for VmfBlock

Source§

fn default() -> VmfBlock

Returns the “default value” for a type. Read more
Source§

impl From<Camera> for VmfBlock

Source§

fn from(val: Camera) -> Self

Converts to this type from the input type.
Source§

impl From<Cameras> for VmfBlock

Source§

fn from(val: Cameras) -> Self

Converts to this type from the input type.
Source§

impl From<Cordon> for VmfBlock

Source§

fn from(val: Cordon) -> Self

Converts to this type from the input type.
Source§

impl From<Cordons> for VmfBlock

Source§

fn from(val: Cordons) -> Self

Converts to this type from the input type.
Source§

impl From<DispInfo> for VmfBlock

Source§

fn from(val: DispInfo) -> Self

Converts to this type from the input type.
Source§

impl From<Editor> for VmfBlock

Source§

fn from(val: Editor) -> VmfBlock

Converts to this type from the input type.
Source§

impl From<Entity> for VmfBlock

Source§

fn from(val: Entity) -> Self

Converts to this type from the input type.
Source§

impl From<Group> for VmfBlock

Source§

fn from(val: Group) -> Self

Converts to this type from the input type.
Source§

impl From<Side> for VmfBlock

Source§

fn from(val: Side) -> Self

Converts to this type from the input type.
Source§

impl From<Solid> for VmfBlock

Source§

fn from(val: Solid) -> Self

Converts to this type from the input type.
Source§

impl From<VersionInfo> for VmfBlock

Source§

fn from(val: VersionInfo) -> Self

Converts to this type from the input type.
Source§

impl From<ViewSettings> for VmfBlock

Source§

fn from(val: ViewSettings) -> Self

Converts to this type from the input type.
Source§

impl From<VisGroup> for VmfBlock

Source§

fn from(val: VisGroup) -> Self

Converts to this type from the input type.
Source§

impl From<VisGroups> for VmfBlock

Source§

fn from(val: VisGroups) -> Self

Converts to this type from the input type.
Source§

impl From<World> for VmfBlock

Source§

fn from(val: World) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<VmfBlock> for Camera

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Cameras

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Cordon

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Cordons

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for DispInfo

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for DispRows

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Editor

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Entity

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Group

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Side

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for Solid

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for VersionInfo

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for ViewSettings

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for VisGroup

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for VisGroups

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.
Source§

impl TryFrom<VmfBlock> for World

Source§

type Error = VmfError

The type returned in the event of a conversion error.
Source§

fn try_from(block: VmfBlock) -> VmfResult<Self>

Performs the conversion.

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> 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, 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.