<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Enums on AI VOID</title><link>https://ai-blog.noorshomelab.dev/tags/enums/</link><description>Recent content in Enums on AI VOID</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 20 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ai-blog.noorshomelab.dev/tags/enums/index.xml" rel="self" type="application/rss+xml"/><item><title>Core Concepts: Structs, Enums, and Pattern Matching</title><link>https://ai-blog.noorshomelab.dev/rust-guide/core-concepts-structs-enums-pattern-matching/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/rust-guide/core-concepts-structs-enums-pattern-matching/</guid><description>&lt;h1 id="core-concepts-structs-enums-and-pattern-matching"&gt;Core Concepts: Structs, Enums, and Pattern Matching&lt;/h1&gt;
&lt;p&gt;As your programs grow, you&amp;rsquo;ll need ways to define custom data types that logically group related pieces of data. Rust provides &lt;code&gt;structs&lt;/code&gt; and &lt;code&gt;enums&lt;/code&gt; for this purpose. Combined with &lt;code&gt;pattern matching&lt;/code&gt;, these features allow you to write expressive, robust, and type-safe code.&lt;/p&gt;
&lt;h2 id="structs"&gt;Structs&lt;/h2&gt;
&lt;p&gt;Structs are custom data types that let you name and package together multiple related values into a meaningful group. Each piece of data in a struct is called a &lt;em&gt;field&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Chapter 6: Structs, Enums, and Powerful Pattern Matching</title><link>https://ai-blog.noorshomelab.dev/rust-mastery-2026/structs-enums-pattern-matching/</link><pubDate>Fri, 20 Mar 2026 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/rust-mastery-2026/structs-enums-pattern-matching/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Welcome back, Rustaceans! In our previous chapters, we laid the groundwork for understanding Rust&amp;rsquo;s core syntax, variables, and the unique concept of ownership. Now, it&amp;rsquo;s time to elevate our data modeling capabilities beyond simple scalars. Imagine trying to describe a person or a color using just individual &lt;code&gt;i32&lt;/code&gt;s or &lt;code&gt;String&lt;/code&gt;s – it would quickly become cumbersome and error-prone.&lt;/p&gt;
&lt;p&gt;This chapter introduces you to Rust&amp;rsquo;s powerful tools for creating custom data types: &lt;strong&gt;structs&lt;/strong&gt; and &lt;strong&gt;enums&lt;/strong&gt;. Structs allow you to group related pieces of data into a single, meaningful unit, much like objects in other languages (but without methods initially). Enums, short for enumerations, let you define a type that can be one of several possible variants, perfect for situations where a value can be &lt;em&gt;either&lt;/em&gt; this &lt;em&gt;or&lt;/em&gt; that.&lt;/p&gt;</description></item><item><title>Chapter 6: Combining and Refining Types: Unions, Intersections, and Enums</title><link>https://ai-blog.noorshomelab.dev/ts-mastery-2025/combining-refining-types-unions-intersections-enums/</link><pubDate>Fri, 05 Dec 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/ts-mastery-2025/combining-refining-types-unions-intersections-enums/</guid><description>&lt;h2 id="chapter-6-combining-and-refining-types-unions-intersections-and-enums"&gt;Chapter 6: Combining and Refining Types: Unions, Intersections, and Enums&lt;/h2&gt;
&lt;p&gt;Welcome back, intrepid TypeScript explorer! In our previous chapters, you&amp;rsquo;ve mastered the basics of declaring variables, defining functions, and creating your own custom types with &lt;code&gt;type&lt;/code&gt; aliases and &lt;code&gt;interface&lt;/code&gt; declarations. You&amp;rsquo;re building a solid foundation, and that&amp;rsquo;s fantastic!&lt;/p&gt;
&lt;p&gt;Today, we&amp;rsquo;re going to unlock even more power and flexibility in TypeScript by learning how to &lt;em&gt;combine&lt;/em&gt; and &lt;em&gt;refine&lt;/em&gt; types. Imagine being able to say, &amp;ldquo;this variable can be &lt;em&gt;either&lt;/em&gt; a number &lt;em&gt;or&lt;/em&gt; a string,&amp;rdquo; or &amp;ldquo;this object must have the properties of &lt;em&gt;both&lt;/em&gt; this type &lt;em&gt;and&lt;/em&gt; that type.&amp;rdquo; That&amp;rsquo;s exactly what &lt;strong&gt;Union Types&lt;/strong&gt; and &lt;strong&gt;Intersection Types&lt;/strong&gt; allow us to do! We&amp;rsquo;ll also dive into &lt;strong&gt;Enums&lt;/strong&gt;, a super handy way to define a set of related constants, making your code more readable and less prone to errors.&lt;/p&gt;</description></item><item><title>Chapter 8: Structures, Unions, and Enums: Custom Data Types</title><link>https://ai-blog.noorshomelab.dev/c-programming-guide/structures-unions-enums/</link><pubDate>Mon, 03 Nov 2025 01:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/c-programming-guide/structures-unions-enums/</guid><description>&lt;h1 id="chapter-8-structures-unions-and-enums-custom-data-types"&gt;Chapter 8: Structures, Unions, and Enums: Custom Data Types&lt;/h1&gt;
&lt;p&gt;So far, we&amp;rsquo;ve worked with primitive data types like &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt;, &lt;code&gt;char&lt;/code&gt;, and arrays of these types. But real-world data is often more complex, requiring a way to group different types of information together. For instance, a &lt;code&gt;Student&lt;/code&gt; might have a name (string), an ID (integer), and a GPA (float).&lt;/p&gt;
&lt;p&gt;C provides tools to define your own &lt;strong&gt;custom data types&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Structures (&lt;code&gt;struct&lt;/code&gt;):&lt;/strong&gt; Allow you to group heterogeneous (different types) data items under a single name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unions (&lt;code&gt;union&lt;/code&gt;):&lt;/strong&gt; Similar to structures, but all members share the &lt;em&gt;same&lt;/em&gt; memory location, allowing you to store different data types at different times in the same space.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enumerations (&lt;code&gt;enum&lt;/code&gt;):&lt;/strong&gt; Provide a way to create named integer constants, improving code readability.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This chapter will teach you how to define, declare, and use these powerful constructs.&lt;/p&gt;</description></item><item><title>Guided Project 1: Command-Line Todo Application</title><link>https://ai-blog.noorshomelab.dev/rust-guide/project-cli-todo-app/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://ai-blog.noorshomelab.dev/rust-guide/project-cli-todo-app/</guid><description>&lt;h1 id="guided-project-1-command-line-todo-application"&gt;Guided Project 1: Command-Line Todo Application&lt;/h1&gt;
&lt;p&gt;In this guided project, you&amp;rsquo;ll build a functional command-line todo application. This project will reinforce many concepts you&amp;rsquo;ve learned, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Structs and Enums for data modeling.&lt;/li&gt;
&lt;li&gt;Ownership and borrowing.&lt;/li&gt;
&lt;li&gt;Error handling with &lt;code&gt;Result&lt;/code&gt; and &lt;code&gt;Option&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;File I/O for persistent data storage.&lt;/li&gt;
&lt;li&gt;Basic command-line argument parsing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our todo application will allow users to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a new todo item.&lt;/li&gt;
&lt;li&gt;Mark an item as completed.&lt;/li&gt;
&lt;li&gt;List all todo items (showing completed status).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;rsquo;ll store todo items in a simple JSON file.&lt;/p&gt;</description></item></channel></rss>