DDD
(Domain-Driven Design), Hexagonal design, and other variants.
DDD
(Domain-Driven Design), Hexagonal design, and other variants.Tonic
and prost
. In hindsight though, the Tonic "hello-world" example is better at this.grpcurl
and familiarise yourself with its options ...(continued)#[repr(C)]
annotation on types.#[repr(C)] struct Foo { tiny: bool, normal: u32, small: u8, long: u64, short: u16, }
impl fmt::Write for ByteMutWriter<'_> { fn write_str(&mut self, s: &str) -> fmt::Result { let cap = self.capacity(); for (i, &b) in self.buf[self.cursor..cap] .iter_mut() .zip(s.as_bytes().iter()) { *i = b; } self.cursor = usize::min(cap, self.cursor + s.as_bytes().len()); Ok(()) } }
buf
and then z ...(continued)
[u8]
(a Dynamically-sized view into a contiguous sequence [T]
) is ideally referred to as a bare slice. We can make the distinction that a shared slice type is &[T]
and one that is mutable is a &mut [T]
.Sized
types).let pointer_size = std::mem::size_of::<&u8>(); assert_eq!(2 * pointer_size, std::mem::size_of::<&[u8]>());
core::array::from_fn
which can be used like thisfn main( ...(continued)
Box<dyn FooTrait>
in a long time, beyond boxing std::error::Error
. I normally reach for generics with impl FooTrait
and you can get a lot done with generics (static dispatch).Any
is a poor man's enum. This code is a great idea of trying to solve something, and wr ...(continued)pub struct SellerItems<Vec<(HashMap<_>)>>
" or something like that. It was bloody awful and my brain shutdown. Taking me outside my comfort zone, was the requirement of writing "pseudocode" in a Google doc. No NeoVim, Rust-analyzer, nada... niet!echo "" printf '%s\n' \ 'WRITE THIS DOWN IN A SECURE PLACE WITH A CRAYON' "$1" \ 'Hide it in a dark hole, darker the better!' 1>&2 echo "" do_log "INFO VeraCrypt file ${VERACRYPT_FILE} mounted at /Volumes/${VERACRYPT_MOUNT_PATH}" # vim: ts=4:sw=4:sts=4:noet:ft=sh
July 2024
May 2024
April 2024
March 2024
February 2024
January 2024
June 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
June 2022
April 2022
March 2022
October 2021
August 2021
July 2021
November 2019
October 2019
June 2019
May 2019
April 2019
September 2017
May 2017
March 2017
January 2017
December 2016
October 2016
August 2016
June 2016
April 2016
February 2016
January 2016
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
November 2014
October 2014
September 2014
August 2014
May 2014
January 2014
December 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
October 2011
January 2011
December 2010
October 2009