You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: publish.rs
    path of file: ./repos/holochain-rust/crates/core/src/network/actions
    
    the code of the file until where you have to start completion: use crate::{
    action::{Action, ActionWrapper},
    context::Context,
    instance::dispatch_action,
    network::actions::NetworkActionResponse,
};
use futures::{future::Future, task::Poll};
use holochain_core_types::error::HcResult;
use holochain_persistence_api::cas::content::Address;
use snowflake::ProcessUniqueId;
use std::{pin::Pin, sync::Arc};

/// Publ
    
    fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context) -> Poll<Self::Output> {
        if let Some(err) = self.context.action_channel_error("PublishFuture") {
            return Poll::Ready(Err(err));
        }

        self.context
            .register_waker(self.id.clone(), cx.waker().clone());

        if let Some(state) = self.context.try_state() {
            let state = state.network();
            if let Err(error) = state.initialized() {
                return Poll::Ready(Err(error));
            }

            match state.actions().get(&self.action) {
                Some(r) => match r.response() {
                    NetworkActionResponse::Publish(result) => {
                        dispatch_action(
                            self.context.action_channel(),
                            ActionWrapper::new(Action::ClearActionResponse(
                                self.action.id().to_string(),
                            )),
                        );
                        self.context.unregister_waker(self.id.clone());
                        Poll::Ready(result.clone())
                    }
                    _ => unreachable!(),
                },
                None => Poll::Pending,
            }
        } else {
            Poll::Pending
        }
    }