<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="202382" data-post-id="202382">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="vrod" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  vrod
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hmm… all of your comments make me inspect refactoring more seriously.  Maybe my solution is improper.  Thank you for your guidance!  I am still learning!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202382" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-implement-enumerable-protocol-for-struct/37269/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-202382" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202382"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="202409" data-post-id="202409">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brettbeatty" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brettbeatty/120/36494_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brettbeatty
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<ol>
<li>the code that calls this is in 3rd party package - I cannot pre-change my struct</li>
</ol>
</blockquote>
<p>I would just echo what the others have said–there might be a way to grab the needed data out of your structs before passing it to the other library. Typically you don’t want to implement protocols for data types for which the protocol doesn’t really make sense (what does it mean to enumerate a datetime?).</p>
<blockquote>
<ol start="2">
<li>academic. I want to know how to do this</li>
</ol>
</blockquote>
<p>I think the code that really made things click for me was the <a href="https://github.com/elixir-lang/elixir/blob/v1.10.4/lib/elixir/lib/range.ex#L102" rel="noopener nofollow ugc">Enumable implementation for Range</a>.</p>
<p>I also tried writing a <a href="https://blog.brettbeatty.com/elixir/custom_data_structures/enumerable" rel="noopener nofollow ugc">blog post</a> about implementing Enumerable for custom data structures, but I don’t know if it’s any clearer.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202409" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/how-to-implement-enumerable-protocol-for-struct/37269/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-202409" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202409"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>