Skip to main content

close

Function close 

Source
pub fn close(talk: &mut Talk, store: &Talks) -> Result<()>
Expand description

Close a conversation. Idempotent: closing an already-closed conversation is not an error, since the operator’s intent - “I am done with this” - is already satisfied.

Re-reads the record under Talks::guard rather than trusting the caller’s copy of talk, and writes that fresh copy back rather than the one passed in. web::talk_close loads talk and calls this right after with no gap of its own, but without the guard that load can still land between a record or turn elsewhere reading the file and writing it back - and a close built on the older snapshot would put it right back, silently dropping whatever turn the other call had just appended.