Skip to main content

Publish

Struct Publish 

Source
pub struct Publish<'a> { /* private fields */ }
Expand description

One exclusive read-modify-write batch. Do not call methods on the owning Spine while this guard lives: its mapping mutex is non-reentrant. Use the guard’s read_* / write_* methods instead. Reads alone do not advance the counter; the first write opens the window and commit/drop closes it.

This is not a rollback transaction. Unwinding closes the window around the partial update, so callers must not interpret a panic as an aborted batch.

Implementations§

Source§

impl Publish<'_>

Source

pub fn is_advisory(&self) -> bool

Whether this batch acquired cross-handle/process publisher exclusion.

Source

pub fn commit(self)

Finish the window and release both locks. Drop has the same effect.

Source

pub fn read_superblock(&self) -> Option<Superblock>

Source

pub fn write_superblock(&mut self, h: &Superblock)

Copy only the payload; the atomic counter is never overwritten.

Source

pub fn read_stream(&self) -> StreamHeader

Source

pub fn write_stream(&mut self, h: &StreamHeader)

Source

pub fn read_hebbian(&self) -> HebbianHeader

Source

pub fn write_hebbian(&mut self, h: &HebbianHeader)

Source

pub fn read_attention(&self) -> AttentionHeader

Source

pub fn write_attention(&mut self, h: &AttentionHeader)

Source

pub fn read_emotion(&self) -> EmotionHeader

Source

pub fn write_emotion(&mut self, h: &EmotionHeader)

Source

pub fn read_resonance(&self) -> ResonanceHeader

Source

pub fn write_resonance(&mut self, h: &ResonanceHeader)

Source

pub fn read_graph(&self) -> GraphHeader

Source

pub fn write_graph(&mut self, h: &GraphHeader)

Source

pub fn read_cache(&self) -> CacheHeader

Source

pub fn write_cache(&mut self, h: &CacheHeader)

Source

pub fn read_archetype(&self) -> ArchetypeHeader

Source

pub fn write_archetype(&mut self, h: &ArchetypeHeader)

Source

pub fn read_mirror(&self) -> MirrorHeader

Source

pub fn write_mirror(&mut self, h: &MirrorHeader)

Source

pub fn read_merkle(&self) -> MerkleHeader

Source

pub fn write_merkle(&mut self, h: &MerkleHeader)

Source

pub fn read_meta(&self) -> MetaHeader

Source

pub fn write_meta(&mut self, h: &MetaHeader)

Source

pub fn tick_stream( &mut self, cycle: u64, surprise: f32, curiosity: f32, predicted_hash: u64, predicted_confidence: f32, last_query_hash: u64, last_query_ms: u64, hebbian_total_energy: f64, epoch_ms: i64, )

Update the stream and publish record using one caller-supplied time. The batch may update other headers before committing the same window.

Trait Implementations§

Source§

impl Drop for Publish<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Publish<'a>

§

impl<'a> !Send for Publish<'a>

§

impl<'a> !UnwindSafe for Publish<'a>

§

impl<'a> Freeze for Publish<'a>

§

impl<'a> Sync for Publish<'a>

§

impl<'a> Unpin for Publish<'a>

§

impl<'a> UnsafeUnpin for Publish<'a>

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more